Javascript 我的引导模式锚不在菜单(导航栏)的行项目内工作
这是我的导航条形码:Javascript 我的引导模式锚不在菜单(导航栏)的行项目内工作,javascript,jquery,html,css,twitter-bootstrap,Javascript,Jquery,Html,Css,Twitter Bootstrap,这是我的导航条形码: <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav" id="menu"> <li><a href="/modalexample.html#theModal" data-toggle="modal">ex</a></li> <li><a href="">Anoth
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav" id="menu">
<li><a href="/modalexample.html#theModal" data-toggle="modal">ex</a></li>
<li><a href="">Another Link here</a></li>
</ul>
</div>
这是我的modalexample.html页面中的模式代码
<div class="modal fade text-center" id="theModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button class="close" data-dismiss="modal">X</button>
<h1>Modal Example</h1>
</div>
<div class="modal-body"> Modal Information Here </div>
<div class="modal-footer"> Footer Stuff Here </div>
</div>
</div>
</div>
由于我不知道的原因,我无法在单击指向页面/modalexample.htmltemodal的链接后显示我的模态
我的锚不能在导航栏内工作有什么原因吗
有没有其他的方法,我可以写这个,使我的模态出现
注意:在这两个页面中,我都包含了jquery-2.1.4.min.js和bootstrap.min.js,jquery脚本放在bootstrap脚本之前
另外,我在两个页面的开头都包含了bootstrap.css样式表的链接
如果需要更多我的代码,请让我知道 无法通过href锚在另一个页面中启动模式。 您可以在modalexample.html中放入javascript代码,以便在加载页面时触发模式:
<script type="text/javascript">
$(window).load(function(){
$('#theModal').modal('show');
});
</script>
为什么要使用/modalexample.htmltemodal?你可以使用像这样的发布演示modalThank你。我不知道无法从另一个页面打开模式。