jQuery UI 对话框 - 关闭后不打开 [英] jQuery UI Dialog Box - does not open after being closed

查看:29
本文介绍了jQuery UI 对话框 - 关闭后不打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 jquery-ui 对话框 有问题.

I have a problem with the jquery-ui dialog box.

问题是当我关闭对话框然后单击触发它的链接时,除非刷新页面,否则它不会再次弹出.

如何在不刷新实际页面的情况下调用对话框.

How can I call the dialog box back without refreshing the actual page.

下面是我的代码:

$(document).ready(function() {
    $('#showTerms').click(function()
    {
        $('#terms').css('display','inline');
        $('#terms').dialog({
            resizable: false,
            modal: true,
            width: 400,
            height: 450,
            overlay: { backgroundColor: "#000", opacity: 0.5 },
            buttons:{ "Close": function() { $(this).dialog("close"); } },
            close: function(ev, ui) { $(this).remove(); },
    }); 
});

谢谢

推荐答案

我解决了.

我使用了 destroy 代替了 close 函数(它没有任何意义),但它起作用了.

I used destroy instead close function (it doesn't make any sense), but it worked.

$(document).ready(function() {
$('#showTerms').click(function()
{
    $('#terms').css('display','inline');
    $('#terms').dialog({resizable: false,
        modal: true,
        width: 400,
        height: 450,
        overlay: { backgroundColor: "#000", opacity: 0.5 },
        buttons:{ "Close": function() { $(this).dialog('**destroy**'); } },
        close: function(ev, ui) { $(this).close(); },
    });         
});   
$('#form1 input#calendarTEST').datepicker({ dateFormat: 'MM d, yy' });
});

这篇关于jQuery UI 对话框 - 关闭后不打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆