2014-01-21 32 views
1

這是我自舉3的數據切換手風琴

<a data-toggle="collapse" href="#collapsible-1">Digital</a> 

    <div id="collapsible-1"> 
     HTML stands for HyperText Markup Language. HTML is the main markup language for describing the structure of Web pages.</a> 
    </div> 

<a data-toggle="collapse" href="#collapsible-2">Radio</a> 

    <div id="collapsible-2"> 
     HTML stands for HyperText Markup Language. HTML is the main markup language for describing the structure of Web pages.</a> 
    </div> 

我用data-toggle boostrap顯示和隱藏元素,但我有一些小問題,就這樣,在加載網頁時可摺疊的內容始終可見的,即使我必須做雙擊關閉元素,之後是工作正常。你認爲我必須做什麼,以collapsabe元素的內容總是隱藏在頁面加載?

回答

0

Bootstrap's documentation摘自:

用法
崩潰插件使用了幾類來處理繁重:

.collapse隱藏內容
.collapse.in顯示內容
。轉換開始時添加了摺疊,並在完成時刪除

因此,在短期:<div id="collapsible-1" class='collapse'>

+0

好,還是老樣子沒有答案的內容,你能不能請添加代碼? – Schneider

+0

您是否像我建議的那樣將類'collapse'添加到您的div中? –

0

您需要的collapse類添加到div隱藏在默認情況下是這樣

<a data-toggle="collapse" href="#collapsible-1">Digital</a> 

    <div id="collapsible-1" class="collapse"> 
     HTML stands for HyperText Markup Language. HTML is the main markup language for describing the structure of Web pages. 
    </div> 

<a data-toggle="collapse" href="#collapsible-2">Radio</a> 

    <div id="collapsible-2" class="collapse"> 
     HTML stands for HyperText Markup Language. HTML is the main markup language for describing the structure of Web pages. 
    </div> 

Js Fiddle Demo