[英]Twitter Bootstrap Dismiss Button not Working
我正在嘗試使用Twitter Bootstrap創建一個詳細描述Minecraft服務器統計數據的網站,以便我的用戶輕松了解哪個服務器在線。 但是,當我在Twitter Bootstrap中使用警報組件時,我無法解除警報。 這是我的代碼:
<!DOCTYPE html>
<title>Dillon's Minecraft Servers</title>
<ul class="nav nav-tabs">
<li><a href="index.htm">Home</a></li>
<li class="active"><a href="#">Vanilla</a></li>
<li><a href="ftb.htm">Feed the Beast</a></li>
<li><a href="bigdig.htm">Big Dig</a></li>
</ul>
<div class="hero-unit">
<h2>Vanilla</h2>
<p>The Vanilla server runs just plain Minecraft. It has some advanced features like Mob Arenas, anti-cheat, and MMO-like leveling.</p>
</div>
<div class="alert">
<a href="#" class="close" data-dismiss="alert">×</a>
<strong>Warning!</strong> This server is currently offline.
</div>
沒關系。 我發現了我的問題。 我忘了將jquery腳本添加到標題中。 對於那個很抱歉。
您是否考慮使用<button>
而不是<a>
。 這就是我在Bootstrap頁面上所做的,因為我遇到了類似的問題。 不能解決這個問題,但它是一種有效的方法
<button type="button" class="close" data-dismiss="alert">×</button>
確保在button.js之前加載了jquery.min.js!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.