bootstrap警告框示例代碼分享
更新時間:2017年05月17日 09:22:02 作者:YY小蘋果
這篇文章主要為大家詳細介紹了bootstrap警告框示例代碼,具有一定的參考價值,感興趣的小伙伴們可以參考一下
本文實例為大家分享了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('當 close 方法被觸發(fā)時調(diào)用!'); }); </script> </body> </html>
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
JavaScript將當前時間轉(zhuǎn)換成UTC標準時間的方法
這篇文章主要介紹了JavaScript將當前時間轉(zhuǎn)換成UTC標準時間的方法,涉及javascript中Date及toUTCString方法的使用技巧,需要的朋友可以參考下2015-04-04使用微信小程序API,調(diào)用微信的各種內(nèi)置能力。
微信小程序如何使用小程序API,去調(diào)用微信提供的各種內(nèi)置能力(即微信API)。小程序開發(fā)框架提供豐富的微信原生API,可以方便的調(diào)起微信提供的能力,如獲取用戶信息,本地存儲,支付功能等。2022-12-12