当前第2页 返回上一页
默认情况下,弹出框在再次点击指定元素后就会关闭,你可以使用 data-trigger="focus" 属性来设置在鼠标点击元素外部区域来关闭弹出框。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <!DOCTYPE html>
<html>
<head>
<title>Bootstrap 实例</title>
<meta charset= "utf-8" >
<meta name= "viewport" content= "width=device-width, initial-scale=1" >
<link rel= "stylesheet" href= "https://cdn.staticfile.org/twitter-bootstrap/4.1.0/css/bootstrap.min.css" >
<script src= "https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js" ></script>
<script src= "https://cdn.staticfile.org/popper.js/1.12.5/umd/popper.min.js" ></script>
<script src= "https://cdn.staticfile.org/twitter-bootstrap/4.1.0/js/bootstrap.min.js" ></script>
</head>
<body>
<div class = "container" >
<h3>弹出框实例</h3> <br>
<a href= "#" title= "取消弹出框" data-toggle= "popover" data-trigger= "focus" data-content= "点击文档的其他地方关闭我" >点我</a>
</div>
<script>
$(document).ready( function (){
$( '[data-toggle="popover"]' ).popover();
});
</script>
</body>
</html>
|
更多Bootstrap相关技术文章,请访问Bootstrap教程栏目进行学习!
以上就是bootstrap4如何设置弹出框的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
聊聊bootstrap4中的网格系统
bootstrap4如何设置弹出框
bootstrap4如何设置按钮
bootstrap3和bootstrap4的区别
bootstrap4的版本有哪些
bootstrap4 过时了吗
bootstrap4兼容哪些浏览器
bootstrap4有哪些版本?
bootstrap4如何设置进度条
更多相关阅读请进入《bootstrap4》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » bootstrap4如何设置弹出框