我想使用 Twitter 的 Bootstrap 设置一个弹出窗口。 我已经成功地使用了其他 JavaScript(下拉菜单和工具提示),但我无法让这个工作。
我的页面中有这个 html:
<a href="#" id="matriz" rel="popover" data-content="And here's some amazing content. It's very engaging. right?" title="A title">hover for popover</a>
我在文档正文中设置了以下内容:
<script>
$(function() {
$('#matriz').popover({placement: 'bottom', trigger: 'hover', offset: 1});
});
</script>
我使用热链接这样调用文件:
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="https://raw.github.com/twitter/bootstrap/master/js/bootstrap-tooltip.js"></script>
<script src="https://raw.github.com/twitter/bootstrap/master/js/bootstrap-dropdown.js"></script>
<script src="https://github.com/twitter/bootstrap/raw/master/js/bootstrap-popover.js"></script>
<script src="https://github.com/twitter/bootstrap/raw/master/js/bootstrap-twipsy.js"></script>
最佳答案
顺便说一句,使用 bootstrap-tooltips.js 和 bootstrap-twipsy.js 是多余的。工具提示取代了 Twipsy。
关于javascript - 即使其他 JS 工作正常,Twitter 的 Bootstrap Popover : Won't work,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9367864/