Bootstrap模態(tài)對話框用法簡單示例
本文實例講述了Bootstrap模態(tài)對話框用法。分享給大家供大家參考,具體如下:
環(huán)境:bootstrap-3.3.5,jquery-3.0.0
代碼:
<!DOCTYPE html>
<html>
<head>
<title>m.fzitv.net bootstrap模態(tài)對話框</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" rel="external nofollow" />
<link rel="stylesheet" rel="external nofollow" />
<script src="https://cdn.bootcss.com/jquery/3.0.0/jquery.min.js" ></script>
<script src="https://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js" ></script>
</head>
<body>
<h2>創(chuàng)建模態(tài)框(Modal)</h2>
<!-- 按鈕觸發(fā)模態(tài)框 -->
<button class="btn btn-primary btn-lg" data-toggle="modal"
data-target="#myModal">
開始演示模態(tài)框
</button>
<!-- 模態(tài)框(Modal) -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title" id="myModalLabel">
模態(tài)框(Modal)標(biāo)題
</h4>
</div>
<div class="modal-body">
在這里添加一些文本
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">關(guān)閉
</button>
<button type="button" class="btn btn-primary">
提交更改
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
</body>
</html>
小編已經(jīng)將代碼中所引用的bootstrap相關(guān)css、js文件全部換成了cdn形式,方便測試。
這里使用在線HTML/CSS/JavaScript代碼運(yùn)行工具:http://tools.jb51.net/code/HtmlJsRun測試,可得到如下顯示效果:

PS:關(guān)于bootstrap布局,這里再為大家推薦一款本站的在線可視化布局工具供大家參考使用:
在線bootstrap可視化布局編輯工具:
http://tools.jb51.net/aideddesign/layoutit
希望本文所述對大家基于bootstrap的程序設(shè)計有所幫助。
- 封裝的dialog插件 基于bootstrap模態(tài)對話框的簡單擴(kuò)展
- Bootstrap 模態(tài)對話框只加載一次 remote 數(shù)據(jù)的完美解決辦法
- Bootstrap模態(tài)對話框的簡單使用
- Bootstrap3 多個模態(tài)對話框無法顯示的解決方案
- BootStrap3中模態(tài)對話框的使用
- Bootstrap基本插件學(xué)習(xí)筆記之模態(tài)對話框(16)
- 基于Bootstrap模態(tài)對話框只加載一次 remote 數(shù)據(jù)的解決方法
- Bootstrap模態(tài)對話框中顯示動態(tài)內(nèi)容的方法
相關(guān)文章
js報錯:Maximum?call?stack?size?exceeded的解決方法
這篇文章主要給大家介紹了關(guān)于js報錯Maximum?call?stack?size?exceeded的解決方法,文中通過實例代碼將解決的方法介紹的非常詳細(xì),需要的朋友可以參考下2023-02-02
JavaScript進(jìn)階(四)原型與原型鏈用法實例分析
這篇文章主要介紹了JavaScript原型與原型鏈,結(jié)合實例形式分析了JavaScript原型與原型鏈基本概念、原理、用法及操作注意事項,需要的朋友可以參考下2020-05-05
微信小程序?qū)崿F(xiàn)的日期午別醫(yī)生排班表功能示例
這篇文章主要介紹了微信小程序?qū)崿F(xiàn)的日期午別醫(yī)生排班表功能,結(jié)合實例形式分析了微信小程序?qū)崿F(xiàn)基于日期時間、針對上午、下午、凌晨、夜間等時段的排班功能相關(guān)操作技巧,需要的朋友可以參考下2019-01-01
JS 組件系列之Bootstrap Table 凍結(jié)列功能IE瀏覽器兼容性問題解決方案
這篇文章主要介紹了JS 組件系列之Bootstrap Table 凍結(jié)列功能IE瀏覽器兼容性問題解決方案,需要的朋友可以參考下2017-06-06
javascript 語法學(xué)習(xí)練習(xí)
javascript 截取字符串排序2008-12-12

