【发布时间】:2012-12-10 21:48:43
【问题描述】:
我已将 UI Bootstrap 主题添加到我的应用程序中,其中大部分似乎运行良好,但我似乎无法让我的 UI 对话框按钮像演示一样正确呈现。似乎 jQuery UI 没有将类添加到按钮,以便按钮将被样式化。
使用 Chrome 开发人员,按钮应呈现为:
<button type="button"
class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
role="button"
aria-disabled="false">
<span class="ui-button-text">Ok</span>
</button>
但是当我创建我的对话框时:
$('#dialog').dialog({
title: 'My Text',
close: function (event, ui) {
myfunction();
},
bgiframe: false,
width: 860,
height: 500,
resizable: true,
modal: true,
buttons: {
Cancel: function () {
$(this).dialog("close");
}
}
});
UI 对话框按钮呈现如下:
<button type="button">Cancel</button>
没有添加任何类,我找不到任何可以告诉我是否需要执行其他方法或交易是什么的信息。
谢谢。
-V
编辑:对不起,我忘了引用我正在使用的版本:
引导程序:2.2.2 jQuery:1.8.3 jQuery UI:1.9.2
【问题讨论】:
-
我不确定这是否可能。您需要使用 JQuery 对话框吗?检查此链接:forums.asp.net/t/1761495.aspx/…
-
您可能会发现这也很有用:addyosmani.github.com/jquery-ui-bootstrap
-
是的,这就是我正在使用的。它在标题和问题的第一行中注明:-)
-
我很抱歉我的错误。你能把你添加的所有css和js文件都放上去吗?我添加了与代码示例中相同的文件并且它正在工作:css/custom-theme/jquery-ui-1.8.16.custom.css、bootstrap/bootstrap.css、js/jquery-1.6.2.min。 js, js/jquery-ui-1.8.16.custom.min.js
标签: jquery twitter-bootstrap jquery-ui-dialog