引入文件
<link rel="stylesheet" href="bootstrap.min.css" rel="external nofollow" >
<link rel="stylesheet" href="style.css" rel="external nofollow" >
<script src="jquery-1.12.4.min.js"></script>
<script src="bootstrap.min.js"></script>
点击‘显示'按钮
$('#modalID').click(function () {
$('#newNotice').modal({backdrop:false})
})
改变内容
$('#changeModalID').click(function () {
$('.notice-content-center').html(data);
})
关闭模态框
$('.close-btn').click(function () {
$('#newNotice').modal('hide')
})
本文介绍了如何使用jQuery和Bootstrap来实现模态框的基本操作,包括显示、改变内容及关闭模态框。通过具体代码示例,展示了如何利用jQuery选择器触发模态框的显示与隐藏,以及如何动态更新模态框内的内容。
1万+

被折叠的 条评论
为什么被折叠?



