0
点赞
收藏
分享

微信扫一扫

jsp新代码第310课

new310.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>bootstrap的使用</title>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<script src="https://fastly.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>

</head>
<body>
<div class="container">
<button type="button" class="btn btn-primary" id="btnDialog">JavaScript触发</button>
<div class="modal fade" id="myModal11">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">标题</h4>
</div>
<div class="modal-body">
<p></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" id="btnClose">关闭</button>
<button type="button" class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#myModal11').on('show.bs.modal',function(e){
alert("show.bs.modal,show方法触发");
}).on('shown.bs.modal',function(e){
alert("shown.bs.modal,show css过渡完成");
}).on('hide.bs.modal',function(e){
alert("hide.bs.modal,hide方法触发");
}).on('hidden.bs.modal',function(e){
alert("hidden.bs.modal,模态框完全隐藏");
});

$("#btnDialog,#btnClose").click(function(){
$("#myModal11").modal("toggle");
});


});
</script>
</body>
</html>


举报

相关推荐

0 条评论