您好,登錄后才能下訂單哦!
小編給大家分享一下BootStrap中彈出層代碼的示例分析,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
具體代碼如下所示:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Bootstrap</title> <link rel="stylesheet" href="css/bootstrap.css" rel="external nofollow" /> </head> <body> <!--注意:1.彈出層必須放在body里 2.彈出層里面不能再嵌套別的層 3.彈出層彈出來以后,頁面的滾動條會被覆蓋--> <div class="container"> <div class="row"> <button class="btn btn-primary" data-toggle="modal" data-target=".myModal1">彈出一個小層</button><!--data-toggle="modal"給button一個點(diǎn)擊事件,彈出一個模態(tài)窗口--> <button class="btn btn-primary" data-toggle="modal" data-target=".myModal2">彈出一個大層</button> </div> </div> <div class="modal fade myModal1"><!--modal,彈出層父級,fade使彈出層有一個運(yùn)動過程--> <div class="modal-dialog"><!--modal-dialog,彈出層--> <div class="modal-content"><!--modal-content,彈出層內(nèi)容區(qū)域--> <div class="modal-header"> <button class="close" data-dismiss="modal">×</button><!--將關(guān)閉按鈕放在標(biāo)題前面可以使按鈕位于右上角--> <h5>水果攤</h5> </div><!--modal-header,彈出層頭部區(qū)域--> <div class="modal-body"> <p>蘋果葡萄香蕉柿子火龍果便宜賣了,多買優(yōu)惠更多,還在等什么呢?</p> <p>蘋果葡萄香蕉柿子火龍果便宜賣了,多買優(yōu)惠更多,還在等什么呢?</p> <p>蘋果葡萄香蕉柿子火龍果便宜賣了,多買優(yōu)惠更多,還在等什么呢?</p> </div><!--modal-body,彈出層主體區(qū)域--> <div class="modal-footer"> <button class="btn btn-primary" data-dismiss="modal">確定</button><!--data-dismiss="modal"點(diǎn)擊按鈕之后可以關(guān)閉窗口--> </div><!--modal-footer,彈出層底部區(qū)域--> </div> </div> </div> <div class="modal myModal2"><!----> <div class="modal-dialog modal-lg"><!--還有modal-sm,modal-md--> <div class="modal-content"> <div class="modal-header"> <button class="close" data-dismiss="modal">×</button> <h5>水果攤</h5> </div> <div class="modal-body"> <p>蘋果葡萄香蕉柿子火龍果便宜賣了,多買優(yōu)惠更多,還在等什么呢?</p> <p>蘋果葡萄香蕉柿子火龍果便宜賣了,多買優(yōu)惠更多,還在等什么呢?</p> <p>蘋果葡萄香蕉柿子火龍果便宜賣了,多買優(yōu)惠更多,還在等什么呢?</p> </div> <div class="modal-footer"> <button class="btn btn-primary" data-dismiss="modal">確定</button> </div> </div> </div> </div> <script src="js/jquery-2.1.0.js"></script> <script src="js/bootstrap.js"></script> </body> </html>
看完了這篇文章,相信你對“BootStrap中彈出層代碼的示例分析”有了一定的了解,如果想了解更多相關(guān)知識,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。