課程
/前端開發
/Bootstrap
/玩轉Bootstrap(JS插件篇)
怎么彈出兩層?就是在這個modal上加個按鈕再彈出
2016-09-20
源自:玩轉Bootstrap(JS插件篇) 1-3
正在回答
<!DOCTYPE HTML>
<html>
<head>
? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
? ? <title>模態彈出窗的使用</title>
? ? <link rel="stylesheet" >
</head>
<body>
<!-- data-target觸發模態彈出窗元素 -->
<button class="btn btn-primary" data-toggle="modal" data-target="#mymodal-data" type="button">通過data-target觸發</button>
<!-- 模態彈出窗內容 -->
<div class="modal fade" id="mymodal-data" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
? ? <div class="modal-dialog">
? ? ? ? <div class="modal-content">
? ? ? ? ? ? <div class="modal-header">
? ? ? ? ? ? ? ? <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
? ? ? ? ? ? ? ? <h4 class="modal-title">模態彈出窗標題</h4>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class="modal-body">
? ? ? ? ? ? ? ? <p>模態彈出窗主體內容</p>
? ? ? ? ? ? <div class="modal-footer">
? ? ? ? ? ? ? ? <button type="button" class="btn btn-default" data-dismiss="modal">關閉</button>
? ? ? ? ? ? ? ? <button type="button" class="btn btn-primary" id="goon">繼續</button>
? ? ? ? </div>
? ? </div>
</div>
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
? ? ? ? ? ? ? ? <button type="button" class="btn btn-primary">保存</button>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script>
? ? $(function(){
? ? ? ? $("#goon").click(function(){
? ? ? ? ? ? $("#modal").modal("toggle");
? ? ? ? })
? ? })
</script>
</body>
筆桿戰神 提問者
舉報
帶領大家學習怎么使用JS自由控制Bootstrap中提供的組件
3 回答modal模態彈出框直接讓其顯示,關不掉模態彈出框
3 回答為什么遮罩層會覆蓋吊我彈出框 我無法選擇
2 回答3-13 彈出框
1 回答angularjs中引入modal插件出現$,moda is not a function
1 回答模態彈出窗后面再加一個窗口怎么讓后加的在上層
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-09-21
<!DOCTYPE HTML>
<html>
<head>
? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
? ? <title>模態彈出窗的使用</title>
? ? <link rel="stylesheet" >
</head>
<body>
<!-- data-target觸發模態彈出窗元素 -->
<button class="btn btn-primary" data-toggle="modal" data-target="#mymodal-data" type="button">通過data-target觸發</button>
<!-- 模態彈出窗內容 -->
<div class="modal fade" id="mymodal-data" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
? ? <div class="modal-dialog">
? ? ? ? <div class="modal-content">
? ? ? ? ? ? <div class="modal-header">
? ? ? ? ? ? ? ? <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
? ? ? ? ? ? ? ? <h4 class="modal-title">模態彈出窗標題</h4>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class="modal-body">
? ? ? ? ? ? ? ? <p>模態彈出窗主體內容</p>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class="modal-footer">
? ? ? ? ? ? ? ? <button type="button" class="btn btn-default" data-dismiss="modal">關閉</button>
? ? ? ? ? ? ? ? <button type="button" class="btn btn-primary" id="goon">繼續</button>
? ? ? ? ? ? </div>
? ? ? ? </div>
? ? </div>
</div>
<div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
? ? <div class="modal-dialog">
? ? ? ? <div class="modal-content">
? ? ? ? ? ? <div class="modal-header">
? ? ? ? ? ? ? ? <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
? ? ? ? ? ? ? ? <h4 class="modal-title">模態彈出窗標題</h4>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class="modal-body">
? ? ? ? ? ? ? ? <p>模態彈出窗主體內容</p>
? ? ? ? ? ? </div>
? ? ? ? ? ? <div class="modal-footer">
? ? ? ? ? ? ? ? <button type="button" class="btn btn-default" data-dismiss="modal">關閉</button>
? ? ? ? ? ? ? ? <button type="button" class="btn btn-primary">保存</button>
? ? ? ? ? ? </div>
? ? ? ? </div>
? ? </div>
</div>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script>
? ? $(function(){
? ? ? ? $("#goon").click(function(){
? ? ? ? ? ? $("#modal").modal("toggle");
? ? ? ? })
? ? })
</script>
</body>