gpt4 book ai didi

twitter-bootstrap - Bootstrap 3,数据显示不起作用

转载 作者:行者123 更新时间:2023-12-03 14:31:48 26 4
gpt4 key购买 nike

我正在使用 Bootstrap 3 ( http://getbootstrap.com/javascript/#modals ) 支持的模态插件,并带有以下标记:

<div class=​"modal fade" id=​"login_modal" tabindex=​"-1" role=​"dialog" aria-labelledby=​"myModalLabel" aria-hidden=​"true" data-show=​"true">​…​</div>​

根据文档,这应该适用于 数据展示属性.. 不幸的是,当页面完成加载时,模式不会自动显示。我在这里没有看到任何问题,所以我希望你们中的一个人能帮我找出问题所在。

PS:
我还发现了一个类似的存在但已经关闭的模态问题,它似乎已在 v3 中重写,所以我认为它不是最新的 ( https://github.com/twbs/bootstrap/issues/5891)。

编辑
我忘了提到的是我当然包括了 Bootstrap 。用一个按钮来打开和关闭它,它工作得很好。 :) 这实际上只是 data-show 属性没有做它应该做的事情

最佳答案

这实际上不是错误,因为 documentation说:

Shows the modal when initialized.



因此,您需要通过 JS“手动”初始化您的 Modal:
<script type="text/javascript">
$( function(){
$('#myModal').modal();
} )
</script>

关于twitter-bootstrap - Bootstrap 3,数据显示不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18855331/

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