亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

bootstrap警告框使用方法解析

 更新時(shí)間:2017年01月13日 11:03:10   投稿:lijiao  
這篇文章主要為大家詳細(xì)介紹了bootstrap警告框使用方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

警告框(Alert)消息大多是用來(lái)想終端用戶顯示諸如警告或確認(rèn)消息的信息。使用警告框(Alert)插件,您可以向所有的警告框消息添加可取消(dismiss)功能。

警告框(Alert)

樣式文件:
LESS版本:源文件 alerts.less

警告框–結(jié)構(gòu)與樣式

<div class="alert alert-success" role="alert">
 <button class="close" data-dismiss="alert" type="button" >&times;</button>
 <p>恭喜您操作成功!</p>
</div>

警告框–使用聲明式觸發(fā)警告框

擊X會(huì)關(guān)閉整個(gè)警告框。
其實(shí)關(guān)閉按鈕,不一定非要用X號(hào),也可以是普通的按鈕元素或者鏈接元素,只需要保證關(guān)閉元素帶有自定義屬性data-dismiss=”alert”即可。

<h3>使用a標(biāo)簽作為關(guān)閉按鈕</h3>
<div class="alert alert-warning" role="alert">
 <h4>謹(jǐn)防被騙</h4>
 <p>請(qǐng)確認(rèn)您轉(zhuǎn)賬的信息是你的親朋好友,不要輕意相信不認(rèn)識(shí)的人...</p>
 <a href="#" class="btn btn-danger" data-dismiss="alert">關(guān)閉</a>
</div>

警告框–JavaScript觸發(fā)警告框

通過(guò)自定義data-dismiss=”alert”屬性來(lái)觸發(fā)警告框關(guān)閉之外,還可以通過(guò)JavaScript方法。只需要在關(guān)閉按鈕上綁定一個(gè)事件

<div class="alert alert-warning" role="alert" id="myAlert">
 <h4>謹(jǐn)防被騙</h4>
 <p>請(qǐng)確認(rèn)您轉(zhuǎn)賬的信息是你的親朋好友,不要輕意相信不認(rèn)識(shí)的人...</p>
 <button type="button" class="btnbtn-danger" id="close">關(guān)閉</button>
</div>
 <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
 <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

 <script>
 $(function(){
 $("#close").on("click",function(){
 $(this).alert("close");
 });
 });
 </script>

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

相關(guān)文章

最新評(píng)論