Home > Web Front-end > JS Tutorial > jQuery ui1.7 dialog can only pop up once_jquery

jQuery ui1.7 dialog can only pop up once_jquery

WBOY
Release: 2016-05-16 18:47:37
Original
1389 people have browsed it
Copy code The code is as follows:

// Display confirmation dialog box
function showConfirm(txtTitle, txtMsg , callback){
getDivDialog().text(txtMsg).dialog({
                                                                                               , title: txtTitle
                                                                                                                                    }
,"No" : function(){
                     $(this).dialog("close");                                                 In ui.1.7.1, the dialog can only be displayed once per button click event. Speechless. . .
There is no explanation in the official documentation. After a Google search, I found that in ui.1.7.1 the dialog must be initialized first.
In document.ready(function(){
//Initialize dialog
})




Copy code


The code is as follows:

$("#layout-confirm").dialog({
autoOpen: false,
modal: true,
title: "Delete"
});
In the subsequent use, there is another point that needs to be paid attention to: Because some dialog parameters are passed in by variables, the option must be attached first and then open. Code example:
Copy code


The code is as follows:


delText.click(function( ; function() {
                                            (file.type == 0){
                                                                                                                                                                                                                                                                                                   "Cancel": function(){
                                                                                                                         layout-confirm").dialog ("open");
});
ok, done~~
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template