JQuery方法第二次不起作用
我有一个JQuery方法。当我点击按钮“BtnSelectExposition”时,弹出窗口出现,但只出现一次。下次不要了。请帮忙JQuery方法第二次不起作用,jquery,asp.net,button,add,Jquery,Asp.net,Button,Add,我有一个JQuery方法。当我点击按钮“BtnSelectExposition”时,弹出窗口出现,但只出现一次。下次不要了。请帮忙 $(function initJQ() { $('#dialogID').dialog({ autoOpen: false, modal: false, minHeight: 20, height: 'auto', width: '
$(function initJQ() {
$('#dialogID').dialog({
autoOpen: false,
modal: false,
minHeight: 20,
height: 'auto',
width: 'auto',
resizable: false,
position: 'center'
,
open: function (event, ui) {
$(this).parent().appendTo("#dialogParentID");
}
});
$('#<%=btnSelectDisclosure.ClientID%>').click(function () {
$('#dialogID').dialog('open');
var x = $(this).position().left - document.scrollleft;
var y = $(this).position().top - document.scrolltop;
$("#dialogID").dialog('option', 'position', [x, y]);
$("#dialogID").dialog("option", "show", 'slide');
return false;
}
);
$('#<%=btnDialogCancel.ClientID%>').click(
function () {
$('#dialogID').dialog("close");
}
);
}
);
$(函数initJQ(){
$('#dialogID')。对话框({
自动打开:错误,
莫代尔:错,
身高:20,
高度:“自动”,
宽度:“自动”,
可调整大小:false,
位置:'中心'
,
打开:功能(事件、用户界面){
$(this.parent().appendTo(“#dialogParentID”);
}
});
$('#')。单击(函数(){
$('#dialogID')。dialog('open');
var x=$(this).position().left-document.scrollleft;
var y=$(this).position().top-document.scrolltop;
$(“#dialogID”).dialog('option','position',[x,y]);
$(“#dialogID”)。对话框(“选项”、“显示”、“幻灯片”);
返回false;
}
);
$('#')。单击(
函数(){
$('#dialogID')。对话框(“关闭”);
}
);
}
);
您需要克隆对话框模板。因此,只需添加以下内容:
$('#dialogID').clone().dialog({ // etc