JS處理事件彈不出對(duì)話框
<head>
<link rel="stylesheet" type="text/css" href="<%=path %>/bs/css/bootstrap.min.css">
? </head>
<body>
? <button class="btn btn-primary" type="button" >按鈕</button>
? <div class="modal fade hide modal-sm" id="themodal">
? <div class="modal-dialog">
? <div class="modal-content">
? <div class="modal-header">
? <button class="close" data-dismiss="modal" type="button"><span>×</span></button>
? <h4 class="modal-title">模式對(duì)話框3標(biāo)題</h4>
? </div>
? <div class="modal-body">
? <p>模式對(duì)話框3內(nèi)容!</p>
? </div>
? <div class="modal-footer">
? <button class="btn btn-default" data-dismiss="modal" type="button">關(guān)閉</button>
? </div>
? </div>
? </div>
? </div>
<script>
? ? $(function(){
? ? ? ? $(".btn").click(function(){
? ? ? ? ? ? $("#themodal").modal();
? ? ? ? });
? ? });
</script>
? ? <script type="text/javascript" src="<%=path %>/bs/jquery-1.12.4.js"></script>
? ? <script type="text/javascript" src="<%=path %>/bs/js/bootstrap.min.js"></script>? ? ??
? </body>
按鈕有樣式,但單擊按鈕沒有反應(yīng),彈不出對(duì)話框
js、css、jquery配置如下圖
2020-05-06
你的方法應(yīng)該在兩個(gè)js后面寫
2019-05-13
modal fade hide modal-sm? 去掉hide? 或者點(diǎn)擊的時(shí)候。。改變modal方法應(yīng)該也有用