jquery UI 对话框和按钮刷新
好吧,我回来了...我正在尝试使 jquery UI 的按钮和对话框插件与我的表单一起使用。我希望重置按钮
<button id="opener" value="reset" type="submit">Reset</button>
能够弹出一个确认对话框,它确实做到了。取消应该关闭对话框并将按钮设置回其原始状态。它很好地关闭,但按钮保持其悬停状态,即使我已经尝试在我能想到的几乎所有地方添加 .refresh 方法。
jQuery(document).ready(function($) {
$(".dialog").dialog({
autoOpen: false,
resizable: false,
modal: true,
title: 'Warning!',
close: function () {
$('#opener').button('refresh');
},
buttons: {
'Continue': function() {
$(this).dialog('close');
},
Cancel: function() {
$(this).dialog('close');
$('#opener').button('refresh')
}
}
});
$('#opener').click(function() {
$('.dialog').dialog('open');
$(this).button('refresh')
return false;
});
});
然后在“继续”响应中,按钮应该继续其原始目的......但这不会发生。我得到一个 return: false 类型的行为,在任何地方都没有 return: false 。
well i'm back... i'm trying to make jquery UI's button and dialog plugins work with my form. i want the reset button
<button id="opener" value="reset" type="submit">Reset</button>
to pull up a confirmation dialog, which it does. cancel should dismiss dialog and set the button back to its original state. it dismisses fine but the button maintains its hover state, even though i have tried adding the .refresh method just about everywhere i can think of.
jQuery(document).ready(function($) {
$(".dialog").dialog({
autoOpen: false,
resizable: false,
modal: true,
title: 'Warning!',
close: function () {
$('#opener').button('refresh');
},
buttons: {
'Continue': function() {
$(this).dialog('close');
},
Cancel: function() {
$(this).dialog('close');
$('#opener').button('refresh')
}
}
});
$('#opener').click(function() {
$('.dialog').dialog('open');
$(this).button('refresh')
return false;
});
});
then on a Continue response the button should continue with its original purpose.. which doesn't happen. i get a return: false type of behavior w/o return: false anywhere.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
jquery 论坛上的某人回答我,对于第一部分,我需要添加
到对话框命令。和
继续功能
someone at the jquery forum answered me that for the first part i need to add
to the dialog commands. and
to the the continue function