【发布时间】:2012-07-18 21:26:37
【问题描述】:
我遇到了这个非常好的 jQuery/bootstrap 模态插件:
http://nikku.github.com/jquery-bootstrap-scripting/
但是,在尝试让最简单的示例运行时,我遇到了一个问题
从他们的网站复制的我的对话框在页面首次加载时显示。
HTML:
<a class="open-dialog" rel="sample1-dialog">trigger</a>
<div id="sample1-dialog" style="display: none">
<h1>Simple alert</h1>
<p>
It is always beneficial to acknowledge alerts of any kind.
You can close this alert if you agree.
(Note: Normally a dialog box is not that penetrating)
</p>
<div class="form-actions">
<button class="btn-primary close-dialog">Understood</button>
<button class="btn-danger" onclick="alert('You might reconsider your click behaviour!')">I don't care</button>
</div>
</div>
jQuery:
$(function () {
$("#sample1-dialog").dialog2({
showCloseHandle: false,
removeOnClose: false,
autoOpen: false,
closeOnEscape: true,
closeOnOverlayClick: true
});
$(".open-dialog").click(function (event) {
event.preventDefault();
$("#sample1-dialog").dialog2("open");
});
这是一个显示问题的小提琴:
我不敢相信这是他们代码的问题。他们的样本工作正常。
我是否遗漏了一些明显的东西?
【问题讨论】:
标签: jquery twitter-bootstrap modal-dialog