JQuery UI对话问题(按钮和自动打开不工作)

时间:2011-02-21 10:25:57

标签: jquery jquery-ui jquery-ui-dialog

我继承了已经有JQuery&的网站的源代码。包含JQueryUI。

的jquery-1.3.2.min.js

1.8.0 / jQuery的ui.min.js

我创建了一个对话框:

        $( "#dialog-modal" ).dialog({
        autoOpen: true, 
        buttons: {
            "Delete": function() {
                $( this ).dialog( "close" );
            },
            "Cancel": function() {
                $( this ).dialog( "close" );
            }
        },
        width: 400,
        height: 175,
        modal: true
    });

<div id="dialog-modal" title="Confirm Company Deletion">
    <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Are you sure you wish to remove this company from the system?<br><br>Whilst the company will no longer be visible after deletion its records will remain within the database and therefore may be recoverable in the future. If this is ever required please contact the system administrator.</p>
</div>

我遇到的第一个问题是对话框没有自动打开。第二个问题是按钮没有显示。但是会应用宽度,高度和模型设置。

如果我调用javascript:$('#dialog-modal')。dialog('open');对话框打开(没有按钮 - 甚至没有创建按钮元素),并且花了好几个小时试图解决这个问题。我需要一些帮助来诊断这个问题,因为我已经尝试改变脚本,库和库的顺序。主题已加载,但它没有任何区别。我正在使用Chrome进行调试,但没有任何错误,因此任何有关财产的建议,任何调试技巧都会受到极大的赞赏。

2 个答案:

答案 0 :(得分:0)

我怀疑你根本就没有调用这段代码。 你打电话时没有出现按钮的原因......

$('#dialog-modal').dialog('open'); 

...因为这是一个完全独立的对话框处理程序调用,它没有指定任何按钮。

答案 1 :(得分:0)

jquery&amp;版本之间的冲突jquery ui

编辑:必须等待2天才能接受自己的答案zzz

相关问题