如何使用jQuery和Bootstrap运行popover?
我将引导与jQuery一起使用 当我运行代码时,窗口只显示内联的按钮列表,按钮周围没有显示任何内容,数据内容消失了 如何解决这些问题如何使用jQuery和Bootstrap运行popover?,jquery,twitter-bootstrap,Jquery,Twitter Bootstrap,我将引导与jQuery一起使用 当我运行代码时,窗口只显示内联的按钮列表,按钮周围没有显示任何内容,数据内容消失了 如何解决这些问题 <!-- popover doesnotworking,i am using bootstrap along with jQuery, when i run the code,the window only appears list of buttons inline, it appears nothing around the butto
<!--
popover doesnotworking,i am using bootstrap along
with jQuery, when i run the code,the
window only appears list of buttons inline,
it appears nothing around the buttons,
tha data contents are gone, and
then how to clear these kind of problems.
-->
<!doctype HTML>
<html>
<head>
<link type="text/css" href="C:\Users\USER\Downloads
\Documents\bootstrap-3.2.0-dist\css\bootstrap.css" rel="stylesheet">
<script src="C:\Users\USER\Downloads\Documents
\bootstrap-3.2.0-dist\js\bootstrap.js"></script>
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/language">
$('.pop a').click(function (e) {
e.preventDefault();
$('.pop').addClass('popnomore')
});
</script>
</head>
<body>
<div class="container" style="padding: 100px 50px 10px;" >
<button type="button" class="btn btn-default" title="Popover title"
data-container="body" data-toggle="popover" data-placement="left"
data-content="Some content in Popover on left">
Popover on left
</button>
<button type="button" class="btn btn-primary" title="Popover title"
data-container="body" data-toggle="popover" data-placement="top"
data-content="Some content in Popover on top">
Popover on top
</button>
<button type="button" class="btn btn-success" title="Popover title"
data-container="body" data-toggle="popover" data-placement="bottom"
data-content="Some content in Popover on bottom">
Popover on bottom
</button>
<button type="button" class="btn btn-warning" title="Popover title"
data-container="body" data-toggle="popover" data-placement="right"
data-content="Some content in Popover on right">
Popover on right
</button>
</div>
<script>$(function ()
{ $("[data-toggle='popover']").popover();
});
</script>
</div>
</body>
</html>
如果您想立即显示popover,请使用:popover'show'
src=C:\Users\US。。。。。。。bootstrap.js是否加载?您是否可以尝试从CDN加载引导,只是为了检查是否加载了引导,正如@Satpal所建议的。是的,它已加载,我使用btn btn primary进行了检查,
$("[data-toggle='popover']").popover('show');