這篇文章給大家分享的是有關(guān)bootstrap中dialog怎么用的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考,一起跟隨小編過來看看吧。
使用過JQuery UI的應(yīng)該知道,它里面有一個(gè)dialog的彈出框組件,功能也很豐富。
與jQuery UI的dialog類似,Bootstrap里面也內(nèi)置了彈出框組件。
打開bootstrap 文檔http://v3.bootcss.com/components/可以看到它的dialog是直接嵌入到bootstrap.js和bootstrap.css里面的,也就是說,只要我們引入了bootstrap的文件,就可以直接使用它的dialog組件,是不是很方便。
使用示例
通過html代碼顯示
<!-- Button trigger modal 彈出框的觸發(fā)器 --><button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> Launch demo modal</button> <!-- Modal 彈出框的結(jié)構(gòu) --><div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h5 class="modal-title" id="myModalLabel">Modal title</h5> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div></div>
這種方式簡(jiǎn)單直觀; 但會(huì)增加html的‘重量',而且不夠靈活,大量使用時(shí)不建議使用
通過js的方式展現(xiàn)
最簡(jiǎn)單的實(shí)現(xiàn)方式:
BootstrapDialog.show({ message: 'Hi Apple!'});
感謝各位的閱讀!關(guān)于“bootstrap中dialog怎么用”這篇文章就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,讓大家可以學(xué)到更多知識(shí),如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!
新聞標(biāo)題:bootstrap中dialog怎么用-創(chuàng)新互聯(lián)
文章位置:http://chinadenli.net/article4/diceie.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動(dòng)網(wǎng)站建設(shè)、企業(yè)建站、服務(wù)器托管、定制網(wǎng)站、網(wǎng)頁設(shè)計(jì)公司、全網(wǎng)營銷推廣
聲明:本網(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í)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容