我有这个按钮,我希望在单击时显示弹出窗口,但是它不起作用。有人可以帮忙吗?
包含外部链接
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
按钮
<button class="buttonsprize" id="bookmark1" name="bookmark1" data-html="true" data-toggle="popover" title="Popover Header" data-content="Some content inside the popover" style="padding:14px;">
<div style="text-align:center;"><i class="fas fa-bookmark"></i></div>
</button>
JavaScript
<script>
$(function () {
$('[data-toggle="popover"]').popover();
});
</script>
答案 0 :(得分:0)
$(function () {
$('[data-toggle="popover"]').popover()
})
<html lang="en">
<head>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</head>
<body>
<button type="button" class="btn btn-lg btn-primary" data-toggle="popover" title="Popover title" data-content="This is bootstrap popover"> popover</button>
</body>
</html>
可以请尝试使用此代码。您可以像这样使用弹出窗口。 :)