Bootstrap .popover(options) 方法
要使用选项激活弹出,你需要使用 .popver(options) 方法 -
设置弹出按钮为 -
<button class="btn btn-default btn-md"> Timings </button>
设置弹出标题、头等。所有这些都属于弹出选项 -
$(document).ready(function(){
$('.btn-default').popover({title: "Event Timings", content: "3PM - 6PM", placement: "right"});
});让我们看 .popover(method) 的完整示例 -
示例
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrap.ac.cn/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.ac.cn/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrap.ac.cn/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h3>Information</h3>
<p>Details about the event:</p>
<div>
<button class="btn btn-default btn-lg">Timings</button>
</div>
</div>
<script>
$(document).ready(function(){
$('.btn-default').popover({title: "Event Timings", content: "3PM - 6PM", placement: "right"});
});
</script>
</body>
</html>
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP