<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">模式对话框3标题</h4>
</div>
<div class="modal-body">
<p>模式对话框3内容!</p>
</div>
<div class="modal-footer">
<button class="btn btn-default" data-dismiss="modal" type="button">关闭</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>
按钮有样式,但单击按钮没有反应,弹不出对话框
js、css、jquery配置如下图
你的方法应该在两个js后面写
modal fade hide modal-sm 去掉hide 或者点击的时候。。改变modal方法应该也有用