我正在使用加载功能加载页面,对话框未打开,但是当我刷新页面时,对话框已经完成。警报正在使用load()。有什么建议?
jQuery( "#edit-address-map" ).live('click', function(){
alert('in');
jQuery( "#edit-address-map-div" ).dialog({
modal: true,
height:370,
width:350,
resizable: true,
draggable: false,
dialogClass: "flora",
close: function(ev, ui) { jQuery(this).dialog('destroy'); }
});
});
答案 0 :(得分:0)
当您点击edit-address-map-div
元素时,您似乎正在尝试打开edit-address-map
对话框。正确?
$(function() {
jQuery( "#edit-address-map" ).live('click', function(){
alert('in');
$('#edit-address-map-div').dialog("open"); // raise the open event on click
});
// wire up the dialog properties when the DOM loads
jQuery( "#edit-address-map-div" ).dialog({
autoOpen: false, // so it won't open when the page loads
modal: true,
height:370,
width:350,
resizable: true,
draggable: false,
dialogClass: "flora",
close: function(ev, ui) { jQuery(this).dialog('destroy'); }
});
});