gpt4 book ai didi

javascript - Twitter Bootstrap 2.1 - 模式无法正常工作

转载 作者:技术小花猫 更新时间:2023-10-29 12:51:04 25 4
gpt4 key购买 nike

我尝试集成 Twitter Bootstrap 模式,但由于某些原因它不起作用。

问题是当页面加载时显示模式。

我在我的 <head> 中写了这个

   <script type="text/javascript">
$('#myModal').modal({show: false,keyboard: false});
</script>

但是没有效果。

我使用的代码:(http://twitter.github.com/bootstrap/javascript.html#modals)

<-- Button to trigger modal -->
<a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>

<-- Modal -->
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>

它在页面加载后直接呈现,如果我再次按下模态按钮它会消失,第二次出现但整个页面都是暗的(甚至模态本身也是暗的)

有人遇到过同样的问题吗?

我将它推送到 heroku,这样您就可以看到问题所在。 http://elobeast.com/(右上角“启动演示模式”)

最佳答案

您需要将类 .hide 添加到模态框的主容器中以隐藏它,直到它被调用为止。

关于javascript - Twitter Bootstrap 2.1 - 模式无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12101104/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com