[英]jquery : javascript dialog box appears only once
This div [#divSaveAndDistribute] appears only once. 该div [#divSaveAndDistribute]仅出现一次。 how can i make it appear anytime it is triggered? 我如何使其在触发时出现? Thanks 谢谢
pic1 = new Image(16, 16);
pic1.src = "images/loader.gif";
$(document).ready(function(){
$("#save").live('click',function() {
//alert("you just clicked me");
var table="products_tb";
$("#status").html('<img src="images/loader.gif" align="absmiddle"> Checking empty fields...');
$("#dialog-confirm").dialog("open");
var dataString = 'table='+table;
//alert(dataString);
//$("#alert").fadeIn(200).html('<img src="images/load/ajax-loader.gif" align="absmiddle">');
$.ajax({
type: "POST",
url: "checkEmpty.php",
data: dataString,
cache: false,
success: function(html)
{
// $("#alert").fadeOut(200); // $(“#alert”)。fadeOut(200);
// $(".confirm").easyconfirm();
$("#status").html(html);
// $("#pled").val(""); // $(“#pled”)。val(“”);
}
//clear_form_elements("form#CommentForm");
});
});
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( "#dialog-confirm" ).dialog({
autoOpen: false,
resizable: false,
height:200,
width:400,
modal: true,
buttons: {
"check": function() {
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
//alert("you just offed me");
$('#divSaveAndDistribute').show();
}
}
});
It should be help full: $( "#dialog-confirm" ).dialog("open"); 应该是完整的帮助:$(“#dialog-confirm”).dialog(“ open”); $( "#dialog-confirm" ).dialog("close"); $(“#dialog-confirm”).dialog(“ close”);
On the bottom of this site: http://jqueryui.com/demos/dialog/ you have list of methods, events and options 在此网站的底部: http : //jqueryui.com/demos/dialog/ ,其中包含方法,事件和选项的列表
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.