2016-09-01 161 views
0

嘿我嘗試使用bootstrap創建一些下拉和摺疊,但它根本不工作。所點擊的內容在點擊時不顯示。儘管我直接從w3學校複製代碼。究竟是什麼問題?我有jQuery下載並保存在同一個文件夾中作爲我的html文件。bootstrap崩潰不起作用

      <head> 
    <script src="jQuery.js"></script> 
    <script src="bootstrap.js"></script> 
    <link rel="stylesheet" href="bootstrap.css"> 
    <title>Bootsrap</title> 
    <meta charset="UTF-8"> 
</head> 

      <button data-toggle="collaspe" data- target="#demo">Collapsible</button> 
     <div id="demo" class="collapse"> 
      some will say that the way to go about doing some of the real things is by 
      doing it by the book to avoid some of the boring things that are said in the 
      latter age of the new and humble heritage of the monk of the new age. 
     </div> 

我真的有bootstrap css和js導入到與我的html加jquery相同的文件夾。

+0

你導入CSS和JS文件的自舉?你可以添加一些代碼嗎? –

+0

我的確如此 – pedroyanky

回答

0

你是否在引導js之前包含jquery js?

在您的瀏覽器控制檯(開發人員工具)中可以看到這些文件包含正確的文件嗎?

+0

這應該是一個評論,而不是一個答案。 http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-c​​an-i-do-instead – ZimSystem

2

Typo。更改data-toggle="collaspe"data-toggle="collapse",並確保您的<button>type="button"

<button type="button" data-toggle="collapse" data-target="#demo">Collapsible</button> 
<div id="demo" class="collapse"> 
    some will say that the way to go about doing some of the real things is by 
    doing it by the book to avoid some of the boring things that are said in the 
    latter age of the new and humble heritage of the monk of the new age. 
</div> 

Bootply

+0

錯在哪裏?我真的看不到任何 – pedroyanky

+0

挑戰自己。密切關注。 – ZimSystem