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

查看:154
本文介绍了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而不是关闭函数(它没有任何意义)但它有效!

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天全站免登陆