欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Bootstrap警告框(Alert)插件使用方法

 更新時間:2017年03月21日 08:53:38   作者:boonyaxnn  
這篇文章主要為大家詳細(xì)介紹了Bootstrap 警告框(Alert)插件的使用方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下

有以下兩種方式啟用警告框的可取消(dismissal)功能:

1、通過 data 屬性:通過數(shù)據(jù) API(Data API)添加可取消功能,只需要向關(guān)閉按鈕添加 data-dismiss="alert",就會自動為警告框添加關(guān)閉功能。

<a class="close" data-dismiss="alert" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" aria-hidden="true">&times;</a> 

2、通過 JavaScript添加可取消功能:

$(".alert").alert() 

html代碼

<div class="alert alert-success"> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="close" data-dismiss="alert" aria-hidden="true">√</a> 
   <strong>成功!</strong>您的網(wǎng)絡(luò)連接已成功! 
  </div> 

效果圖:

3、下面是一些警告框(Alert)插件中有用的方法:

效果圖

4、下表列出了警告框(Alert)插件中要用到的事件。這些事件可在函數(shù)中當(dāng)鉤子使用。

html代碼

<!DOCTYPE html> 
<html> 
 <head> 
  <title>Bootstrap 警告框(Alert)插件</title> 
  <meta charset="utf-8"> 
  <link rel="stylesheet" href="css/bootstrap.min.css" rel="external nofollow" >  
  <script src="js/jquery.min.js"></script> 
  <script src="js/bootstrap.min.js"></script> 
  <style> 
   body{ 
    font-size:24px; 
     
   } 
  </style> 
 </head> 
 <body> 
  <div class="container"> 
  <h3>警告框(Alert)插件 alert() 方法</h3> 
  <div id="myAlert" class="alert alert-warning"> 
   <a href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" class="close" data-dismiss="alert">×</a> 
   <strong>警告!</strong>您的網(wǎng)絡(luò)連接有問題。 
  </div> 
  <script type="text/javascript"> 
   $(function() { 
   $("div#myAlert").bind('click',function () { 
    alert("警告消息框被關(guān)閉。"); 
    }); 
   }); 
  </script> 
  </div> 
  
 </body> 
</html> 

效果圖:

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論