2013-04-28 50 views
3

我在使用Twitter引导模式时遇到问题。即使点击关闭按钮,它也不会关闭。Twitter-bootstrap模式不会在点击时关闭

我已经创建了从开始可用的模式,即在页面加载时显示模式。我没有使用任何JavaScript。

下面是代码

<div id="myModal2" class="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true"> 
<div class="modal-header"> 
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> 
    <h3 id="myModalLabel2">Instructions</h3> 
</div> 
<div class="modal-body"> 
    <ol><li>Please press either left or right arrow button to start the carousel.</li><li>For continuous movement either put the cursor on this dialog or outside the viewport</li></ol> 

</div> 
<div class="modal-footer"><button class="btn" data-toggle="modal" data-target="#myModal">View Source</button> 
    <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Close</button> 
</div> 

有一两件事,我应该提到,我在同一个页面两个相模态。

如果你想看到的页面直播,这里是链接 http://nazmulweb.com/bootstrap_carousel_full_page_fade

如果您有什么需要了解更多信息,请让我知道。

非常感谢。

+0

尝试添加淡入淡出类模态即'类=“模式变脸”' – anpsmn 2013-04-28 18:37:38

+0

@anpsmn如果我的页面加载的模式是不可见的过程中添加“变脸”的类。 – Hoque 2013-04-28 18:41:16

+1

我想bootstrap希望所有的类都在那里隐藏模态淡入淡出。你可以给所有的类并通过脚本'$('#myModal')。modal('show')'显示模态。 – anpsmn 2013-04-28 18:52:13

回答

0

尝试向模态div添加隐藏和淡入淡出类。 即

<div id="myModal2" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true"> 
2

我有同样的问题。我可以通过在页面底部放置对话框来解决这个问题(在关闭body标签之前)

0

您可以使用此关闭按钮。

<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> 
相关问题