2013-04-28 84 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>