簡體   English   中英

Twitter Bootstrap Dismiss按鈕不起作用

[英]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">&times;</a>
    <strong>Warning!</strong> This server is currently offline.
</div>

沒關系。 我發現了我的問題。 我忘了將jquery腳本添加到標題中。 對於那個很抱歉。

您是否考慮使用<button>而不是<a> 這就是我在Bootstrap頁面上所做的,因為我遇到了類似的問題。 不能解決這個問題,但它是一種有效的方法

<button type="button" class="close" data-dismiss="alert">&times;</button>

確保在button.js之前加載了jquery.min.js!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM