From the beginning of using alert to prompt, to the later jQuery manual writing popover, and then to use the Layer popover plug-in to complete, to now use the Dialog plug-in to complete the popover, step by step exploration, step by step harvest.
Most of the popovers in the project are now done using dialog, especially when dialog is paired with template
First of all, attach the effect picture:
After introducing uI-dialog.css and dialog.js, you can use dialog({}) to indicate your popover where you need it, don’t omit the.showmodal () after it
The title represents the title of the popover and the content represents the content of the popover. In this example, template is used to load the contents of the popover. The template code is not shown. The content of the content can be written as “Are you sure to delete this entry?” ; OkValue indicates the contents of the confirm button; CancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue cancelValue
Sometimes, a project will require two different popovers, such as this one:
Dialog is also handy in this case, as follows:
Just write a single deleteCss function in the common file and call it wherever you need it. Don’t worry about using two different popover styles in one project