Bootstrap導航欄摺疊菜單不適用於Turbolinks。Bootstrap導航欄摺疊菜單不適用於Turbolinks
工作方案
在頁面加載
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> </button> <div class="navbar-collapse collapse" id="menu"> </div>
點擊菜單和下拉
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> </button> <div class="navbar-collapse in" id="menu" style="height: auto;"> </div>
點擊菜單增益和崩潰
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> </button> <div class="navbar-collapse collapse" id="menu" style="height: 1px;"> </div>
不工作
在頁面加載
the same html, no need to repeat
點擊菜單和下拉
(導航到任何頁面後)the same html, no need to repeat
再次單擊菜單和崩潰
3.1。在調試器觀察到的瞬時變化
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> </button> <div class="navbar-collapsing" id="menu" style="height: 96px;"> </div>
注:類= 「Navbar的塌陷」和高度:96PX;
3.2。然後回到同一狀態
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> </button> <div class="navbar-collapse in" id="menu" style="height: auto;"> </div>
注:相同的HTML第2步中
利布斯版本:
- Turbolinks 2.1.0
- JQuery的2.0。 3
- Bootstrap 3.0.3
我希望有人能想出一個真實的答案或解釋。
同樣的問題與我
文件,玩了一段時間後想通了禁止是最好的。但能夠有Turbo鏈接將會很酷。 –
在這個問題上的任何更新? –
我根本不使用Turbo鏈接,我正在做單頁應用程序。 – givanse