微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

twitter-bootstrap – 使用Twitter Bootstrap的警报关闭不工作?

我正在使用Google Chrome.
使用 Twitter Bootstrap,我想添加一个简单的警报,不幸的是,alert不是在x被按下时被解雇!

这是我的基于alert文档的代码

<!DOCTYPE html>
<html>
  <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
  </head>
  <body>    
    <div class="alert">
        <button type="button" class="close" data-dismiss="alert">×</button>
        <strong>Warning!</strong> Best check yo self,you're not looking too good.
    </div>      
  </body>
</html>

我也试过:

<!DOCTYPE html>
  <html>
    <head>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
      <!-- Bootstrap -->
      <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    </head>
    <body>    
    <div class="alert">
        <a href="#" class="close" data-dismiss="alert">×</a>
        <strong>Warning!</strong> Best check yo self,you're not looking too good.
    </div>      
    </body>
  </html>

缺少什么是让它解雇?

解决方法

感谢 davidkonrad评论.
解决方法是微不足道的,添加
<script src="js/bootstrap.min.js"></script>

原文地址:https://www.jb51.cc/bootstrap/234107.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐