我使用Twitter的引导模式,当我点击链接,仍是黑色的淡出将出现在模态。
仅供参考- https://docs.google.com/file/d/0B7s0BYiHsMBtY1pLdmVsclpQXzA/edit?usp=sharing
这里是我的代码:
<ul class="nav pull-right">
<li><a href="#myModal" data-target="#myModal" data-toggle="modal">Signin</a></li>
</ul>
<div id="myModal" class="modal hide fade" 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>
我找到了一个工作示例这里 :
的jsfiddle
注意:当你想隐藏褪色的黑色只是删除backdrop: true;
从jQuery。
HTML:
<div id="event-modal" class="modal hide fade">
<div class="modal-header">
<a class="close" href="#">x</a>
<h3>Modal Heading</h3>
</div>
<div class="modal-body">
<p>Some information</p>
</div>
<div class="modal-footer">
<a class="btn primary" href="#">Primary</a>
<a class="btn secondary" href="#">Secondary</a>
</div>
</div>
<a href="/events/2-fefewfewfe/rsvps" data-backdrop="true" data-controls-modal="event-modal" data-keyboard="true">I'm attending!<span class="ico join"></span></a>
JQUERY:
$(function() {
$('#event-modal').modal({
backdrop: true
});
});
CSS:
#event-modal {
margin-top: 0;
}
这看起来像CSS问题。 检查的东西不会覆盖模式z-index
属性,默认模式有:
.modal {
z-index: 1050;
}
和背景:
.modal-backdrop {
z-index: 1040;
}
莫代尔应该有更高的价值。
相同的代码工作正常,我..请检查您的JS文件被正确或不添加..
ESP。 自举modal.js,引导,transition.js
检查一次这个小提琴:
http://jsfiddle.net/7vyUQ/
<ul class="nav pull-right">
<li><a href="#myModal" data-target="#myModal" data-toggle="modal">Signin</a></li>
</ul>
<div id="myModal" class="modal hide fade" 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>