ASP.Net按钮和jQuery弹出窗体
下面是我用于模式弹出表单的代码ASP.Net按钮和jQuery弹出窗体,jquery,asp.net,Jquery,Asp.net,下面是我用于模式弹出表单的代码 $("[id*=btnFinish").live("click", function () { $("#timeLeft").dialog({ title: "There's Time Left!!", open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); }, modal: true,
$("[id*=btnFinish").live("click", function () {
$("#timeLeft").dialog({
title: "There's Time Left!!",
open: function (event, ui) {
$(".ui-dialog-titlebar-close").hide();
},
modal: true,
draggable: false,
resizable: false
});
return false;
});
} else {
$("#timesUp").dialog({
title: "Time is up!",
open: function (event, ui) {
$(".ui-dialog-titlebar-close").hide();
},
modal: true,
draggable: false,
resizable: false
});
}
单击继续以启动第一个考试模块。
你可以回去,复习你的答案,如果需要的话可以修改。或者,您可以继续下一个模块并单击“继续”。
在我的代码隐藏中,如您所见,div=“timeLeft”
包含两个按钮btnproced
和btnBack
btnproced
具有与div=“timesUp”
中的btnProce
相同的功能。现在,我的问题是当显示div=“timeLeft”的模式弹出窗口时,当用户单击btnBack
时,我希望模式弹出窗口关闭并执行代码隐藏。我真的不知道怎么做。add
$("#btnBack").trigger('click');
在if语句下,它应该是这样的
$("[id*=btnFinish").live("click", function () {
$("#timeLeft").dialog({
title: "There's Time Left!!",
open: function (event, ui) {
$(".ui-dialog-titlebar-close").hide();
$("#btnBack").trigger('click');
},
modal: true,
draggable: false,
resizable: false
});
return false;
});
} else {
$("#timesUp").dialog({
title: "Time is up!",
open: function (event, ui) {
$(".ui-dialog-titlebar-close").hide();
},
modal: true,
draggable: false,
resizable: false
});
}
您使用的是哪个版本的jQuery?以下是我的脚本:
$("[id*=btnFinish").live("click", function () {
$("#timeLeft").dialog({
title: "There's Time Left!!",
open: function (event, ui) {
$(".ui-dialog-titlebar-close").hide();
$("#btnBack").trigger('click');
},
modal: true,
draggable: false,
resizable: false
});
return false;
});
} else {
$("#timesUp").dialog({
title: "Time is up!",
open: function (event, ui) {
$(".ui-dialog-titlebar-close").hide();
},
modal: true,
draggable: false,
resizable: false
});
}