本文實(shí)例為大家分享了bootstrap警告框的具體代碼,供大家參考,具體內(nèi)容如下
<!DOCTYPE html> <html lang="zh-CN"> <head>  <meta charset="utf-8">  <meta http-equiv="X-UA-Compatible" content="IE=edge">  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">  <title>XXX</title>  <link rel="stylesheet" href="lib/bootstrap/css/bootstrap.css" rel="external nofollow" >  <link rel="stylesheet" href="css/main.css" rel="external nofollow" >  <!--[if lt IE 9]>  <script src="lib/html5shiv/html5shiv.min.js"></script>  <script src="lib/respond/respond.min.js"></script>  <![endif]--> </head> <body>  <div class="alert alert-danger fade in"><!--淡入淡出-->  <button type="button" class="close" data-dismiss="alert">   <span>×</span>  </button>  <p>   警告:你的瀏覽器不支持  </p> </div> <br> <br> <br> <!--用jQuery代替data-dismiss="alert"--> <div class="alert alert-danger fade in" id="alert"><!--淡入淡出-->  <button type="button" class="close">   <span>×</span>  </button>  <p>   警告:你的瀏覽器不支持  </p> </div>  <script src="lib/jquery/jquery.js"></script> <script src="lib/bootstrap/js/bootstrap.js"></script> <script src="js/main.js"></script> <script>  $('.close').on('click', function () {   $('#alert').alert('close');  })    //事件,其他雷同  $('#alert').on('close.bs.alert', function () {   alert('當(dāng) close 方法被觸發(fā)時(shí)調(diào)用!');  }); </script> </body>  </html> 以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持武林網(wǎng)。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注