[問題] bootstrap popover

看板Web_Design作者 (Arim5566)時間13年前 (2013/02/28 21:46), 編輯推噓3(301)
留言4則, 3人參與, 最新討論串1/1
各位版友好 最近學了一點CSS基礎之後今天開始學習bootstrap 目前的版本好像把本來所有的javascript plugin都放到js/bootstrap.js裡面 網路上面的範例大多是把js檔給分開的 我現在想要把一個簡單的popover顯示出來都有問題0.0 <!DOCTYPE HTML> <html> <head> <link type = "text/css" rel = "stylesheet" href = "css/bootstrap.css"> </head> <body> <div class = "container"> <h2>Example of creating Modal with Twitter Bootstrap</h2> <div class="well"> <a href = "#" id = "example" class = "btn btn-danger" rel = "popover" data-content = "test-content" data-original-title = "test-title">hover for popover</a> </div> </div> <script src = "js/bootstrap.js"></script> <script> $('#example').popover('toggle'); </script> </body> </html> 沒學過javascript 只是看官方網站的code貼上去(就一行) 預設trigger的方式是click http://twitter.github.com/bootstrap/javascript.html 只是一直都沒看到popover的效果出來 請使用過bootstrap的版友協助了T.T 謝謝 -- ~宅男的四個徵兆~ ∠□ ○ ! * \○/ ★    (○ ? ╦╦└□ " ○□═ □   □> ║║√√ ╦══╦ ∥    |\ 一回家就上PTT 每天想正妹 以當好人為樂 忘記正妹虧欠自己 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.121.49.233 ※ 編輯: Arim 來自: 122.121.49.233 (02/28 21:50)

02/28 21:58, , 1F
似乎要先引入jQuery檔
02/28 21:58, 1F
jQuery似乎也都是放在bootstrap.js裡面了? 因為下載回來就只有bootstrap.js ※ 編輯: Arim 來自: 122.121.49.233 (02/28 22:11)

02/28 22:19, , 2F
jquery我記得要自己帶
02/28 22:19, 2F
加入 <script src="" rel="nofollow">https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"> </script> 還是不行... ※ 編輯: Arim 來自: 122.121.49.233 (02/28 22:50)

02/28 22:58, , 3F
插到"js/bootstrap.js"那行上面
02/28 22:58, 3F
謝謝T大,放到前面那行就成功了:) 感謝 我之後索性從github把所有的檔案抓回來(包括popover.js及tooltip.js) 然後照著w3resource的範例程式寫一樣的code, 當然js及css檔案路徑有修改 http://www.w3resource.com/twitter-bootstrap/popover-tutorial.php 結果還是沒辦法顯示T.T 很想知道為什麼 有人可以成功顯示上面範例嗎? ※ 編輯: Arim 來自: 122.121.49.233 (02/28 23:02) ※ 編輯: Arim 來自: 122.121.49.233 (02/28 23:04) ※ 編輯: Arim 來自: 122.121.49.233 (02/28 23:04) ※ 編輯: Arim 來自: 122.121.49.233 (02/28 23:05) ※ 編輯: Arim 來自: 122.121.49.233 (02/28 23:06) ※ 編輯: Arim 來自: 122.121.49.233 (02/28 23:08)

02/28 23:21, , 4F
範例是正常的,你的 code 呢?
02/28 23:21, 4F
文章代碼(AID): #1HBr-a7x (Web_Design)