dialog box (dialog) is a very important feature of the jquery UI. It completely replaces JavaScript.Alert (), prompt () and other methods, also avoids the new window or the complex redundancy of the page.
A Open Multiple DialogThis can be done as long as you set a different ID.
$ (' #x '). dialog ();
$ (' #y
Similar to the deletion of the effect, before the execution, generally need to add confirmation dialog, click to confirm the execution of the words, the Cancel button will not execute, traditional JSif (Confirm (' OK to delete? ‘)){Execute code}This effect is ugly, use jquery mobile to optimizeFiles that need to be ref
Compared to the browser's own alert, confirm, and capabilities, I prefer that everything is custom:First of all in the head tag (of course, like other places to look at) the introduction of plug-in style sheets and JS.-must first introduce jquery-introduced plugin JSThe next step is to invoke the method, first look at the beautiful effect:The above image effect is calledMethod of Use:Next details the effect
Jquery-easyui provides simplified encapsulation. This allows us to implement web UI more conveniently.
The confirm method is described as follows in its sample:
function confirm1(){
$.messager.confirm('My Title', 'Are you confirm this?', function(r){
if (r){
alert('confirmed:'+r);
location.
Compile jQuery plug-ins by yourself to simulate alert, confirm, and jqueryalert
Don't say anything. First, there is a picture with the truth :)
Currently, most websites do not need their own alert and confirm, because the interface is too stiff. So this plug-in produces...
Let's look at the implementation code of the plug-in:
(Function () {$. msgBox = {Alert:
Now I will introduce two jquery plug-in, they are confirm and help message. Maybe you will need them in some development situation.
Confirm
1. What is confirm?
You can base on the name, guess what it is?
It include two buttons which is "yes" and "no", you can choose one of the buttons to tell the system what will be do
Custom Confirm PluginsCustom Confirm PluginsIdea: 1. Event action: Displays a div layer with ID myconfirm and returns false;2. Event Action: callback function call Trigger () method to automatically execute the event, change status value, return to status;var status=false;//is defined as a Global object: Records dialog execution State$.fn. Myconfirm = function ($
Jquery-confirm is a powerful jquery dialog box and confirmation box plug-in, very simple to use, I also encountered some problems when using, how to set the button in Chinese. Refer to the document to know that it was the way it was done below. The effect is as follows: Code is as follows:
Project Address: http:
the use is very convenient if you are not satisfied with the interface style or the color style of your site inconsistent, it can only be modified by itself.Because the popup layer (DIV) cannot do the page blocking effect like the original alert and confirm, it can only be simulated by a callback function. For this reason, background data operations can only be done with the callback function with Ajax.The demo is as follows:HTMLxmlns= "http://www.w3
Website:Https://fullcalendar.io/docshttp://craftpip.github.io/jquery-confirm/Focus:1, the event data source, can be JSON2, can be in toolbar custom button, with custombuttons realization function3, Eventclick, return flase, the original event does not executeTemplate1{% extends'mobj/blank.html'%}2 3{% block Custom_style%}4"/static/css/jquery/
This example database structure is very simple, just a field on the line
Jquery.confirm.js
Copy Code code as follows:
(function ($) {
$.confirm = function (params) {
if ($ (' #confirmOverlay '). Length) {
A confirm is already shown on the page:
return false;
}
var buttonhtml = ';
$.each (Params.buttons,function (name,obj) {
Generating the markup for the buttons:
buttonhtml + = ' if (
Alert, confirm solution based on jquery ui (skin replacement supported), jqueryconfirm
Functions:
1. Modify the title style. Put the title style of jquery ui. Supports skin replacement.
2. Change the button style to the jqueryui button style.
3. Replace the background of the model window with the modeled background of jqueryui.
Code:
// First introduce
The jquery UI is a jquery based open source JavaScript Web user interface code base. A visual control that contains low-level user interaction, animations, effects, and replaceable topics.
Preparing for the JQuery environment
First, we create a button, and when we click on the button, a dialog box pops up.
This article mainly introduces alert and confirm solutions based on jqueryui (supports skin replacement), which are modified from the source code of netizens. For more information, see. Functions:
1. modify the title style. Put the title style of jquery ui. Supports skin replacement.
2. change the button style to the jqueryui button style.
3. replace the background of the model window with the modeled back
This article mainly introduces alert and confirm solutions based on jqueryui (supports skin replacement), which are modified from the source code of netizens. For more information, see. Functions:
1. Modify the title style. Put the title style of jquery ui. Supports skin replacement.
2. Change the button style to the jqueryui button style.
3. Replace the background of the model window with the modeled back
First of all, introduce the two plug-ins function
1.DataTables is a form of jquery plug-in.
Official website and its download address: http:/www.datatables.net
The main features are as follows:
1. Automatic Paging processing
2. Instant Tabular Data filtering
3. Data sorting and data type automatic detection
4. Automatically handle column widths
5. Can be customized through the CSS style
6. Support for hidden columns
7. Easy to use
8. Scalab
1, first reference:
2. Tips for message tip:
Layer.tips (' Please fill out the total amount of the library, then click on the right side of the Detailed Settings button to select the batch. ', ' #outcount ');
3, play the window on the full screen
The code is as follows
Copy Code
var index = Layer.open ({Type:2,Content: ' list.html?op=selectoutcount= ' + outcount,Area: [' 300px ', ' 195px '], Title:false,Maxmin:true, closebtn:0});Layer.full (index);
4. Mes
This example describes the JQuery Dialog dialog box event usage. Share to everyone for your reference, specific as follows:
Dialog dialog Box Event
dialog box Application scenario
dialog
JQuery-Dialog (pop-up window, masking window), jquery-dialog window
Pop-up and masking windows that are frequently used in Ajax. Writing by yourself is definitely the best solution, but the time and cost decide to find a ready-made one. For more information, see. I need to meet several of my requirements
Be concise a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.