這篇文章主要介紹BootStrap中動(dòng)態(tài)模態(tài)框以及靜態(tài)模態(tài)框的實(shí)現(xiàn)方法,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
成都創(chuàng)新互聯(lián)專(zhuān)注于企業(yè)全網(wǎng)整合營(yíng)銷(xiāo)推廣、網(wǎng)站重做改版、開(kāi)封網(wǎng)站定制設(shè)計(jì)、自適應(yīng)品牌網(wǎng)站建設(shè)、H5響應(yīng)式網(wǎng)站、商城開(kāi)發(fā)、集團(tuán)公司官網(wǎng)建設(shè)、外貿(mào)網(wǎng)站建設(shè)、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁(yè)設(shè)計(jì)等建站業(yè)務(wù),價(jià)格優(yōu)惠性價(jià)比高,為開(kāi)封等各大城市提供網(wǎng)站開(kāi)發(fā)制作服務(wù)。
要用bootStrap這個(gè)框架就必須要重載它的class類(lèi),也就是說(shuō)class要一樣
代碼如下:
動(dòng)態(tài)模態(tài)框
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <link rel="stylesheet" href="bootstrap-3.3.7/css/bootstrap.css"> <script src="bootstrap-3.3.7/js/jquery.min.js"></script> <script src="bootstrap-3.3.7/js/bootstrap.min.js"></script> <script src="bootstrap-3.3.7/js/docs.min.js"></script> </head> <body> <div> <div> <div>bootstrap框架 <small>s</small> </div> </div> <!-- 動(dòng)態(tài)框 --> <div> <!-- modal默認(rèn)是隱藏的 --> <div> <div> <!-- 頭部關(guān)閉按鈕 --> <div> <button type="button" class="close myclose" data-dismiss="modal"><span >×</span></button> <div class="h4 modal-title">標(biāo)題部分</div> <!-- 內(nèi)容部分 --> <div> <P>這是內(nèi)容部分</P> </div> <!-- 頁(yè)腳 --> <div> <button type="button" class="btn btn-primary myclose" data-dismiss="modal">Close</button> <button type="button" class="btn btn-warning myclose">save</button> </div> </div> </div> </div> </div> <a href="#" class="btn btn-success" id="show">顯示對(duì)話框</a> </div> </body> </html> <script> $(function(){ $('#show').click(function(){ $('.modal').modal('show') }) }) </script>
靜態(tài)模態(tài)框
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <link rel="stylesheet" href="bootstrap-3.3.7/css/bootstrap.css"> <script src="bootstrap-3.3.7/js/jquery.min.js"></script> <script src="bootstrap-3.3.7/js/bootstrap.min.js"></script> <script src="bootstrap-3.3.7/js/docs.min.js"></script> </head> <body> <div> <div> <div>bootstrap框架 <small>s</small> </div> <!-- 靜態(tài)模態(tài)框 官方有一個(gè)bug就是在寫(xiě)靜態(tài)框的時(shí)候在按鈕上要綁定同一個(gè)class--> <div> <div> <div> <button type="button" class="close myclose" data-dismiss="modal"> <span>×</span> </button> <h4>Model標(biāo)題</h4> </div> <!-- body部分 --> <div> <p>這是身體部分</p> </div> <!-- footer部分 --> <div> <button class="btn btn-info myclose" data-dismiss="modal">close</button> <button class="btn btn-primary myclose">save</button> </div> </div> </div> </div> </div> </div> </div> </body> </html> <script> $(function(){ $('.myclose').click(function(){ $('.modal-dialog').css('display','none') }) }) </script>
以上是BootStrap中動(dòng)態(tài)模態(tài)框以及靜態(tài)模態(tài)框的實(shí)現(xiàn)方法的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)站標(biāo)題:BootStrap中動(dòng)態(tài)模態(tài)框以及靜態(tài)模態(tài)框的實(shí)現(xiàn)方法
文章網(wǎng)址:http://muchs.cn/article2/ghseic.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航、域名注冊(cè)、企業(yè)建站、靜態(tài)網(wǎng)站、搜索引擎優(yōu)化、移動(dòng)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)