【发布时间】:2011-11-14 00:11:27
【问题描述】:
我在我的 ruby on rails 应用程序中使用 jQuery 模式对话框。这是我的代码:
var html = '';
html += '<div id="dialog-form">';
html += 'This is a test.';
html += '<button id="form-close" class="close-button" type="button" onclick="$(\'#dialog-form\').dialog(\'close\');">Close</button>';
html += '</div>';
var dialog_form = $(html).dialog({
autoOpen: false,
width: 600,
height: 640,
modal: true,
open: function() {
$(".ui-dialog-titlebar").hide();
},
close: function(event, ui) {
$('#dialog-form').remove();
}
});
dialog_form.dialog('open');
我在另一个应用程序中使用了相同的代码,它运行良好。
在我当前的应用程序中,此脚本不是呈现模式对话框,而是呈现透明对话框窗口。文本和按钮正确呈现。但是,对话框是透明的,而不是模态的。
我确定我已经包含了 jquery.js 和 jquery-ui.js。
我不知道我在做什么有什么问题。请帮忙。
谢谢。
【问题讨论】:
-
好像没有在页面中添加jquery-ui主题css文件。
-
谢谢,这就是我所缺少的。墨菲定律的例证!
标签: jquery ruby-on-rails jquery-ui