Popovers不适用于bootstrap?(Popovers don't work with bootstrap?)
在我复制的文档之后:
<div class="container"> <div class="row"> <div class="bs-docs-example" style="padding-bottom: 24px;"> <a href="#" class="btn btn-large btn-danger" rel="popover" data-content="And here's some amazing content. It's very engaging. right?" data-original-title="A Title">Click to toggle popover</a> </div> </div> </div>的jsfiddle
但它不起作用。 我究竟做错了什么?
Following the documentation I copied:
<div class="container"> <div class="row"> <div class="bs-docs-example" style="padding-bottom: 24px;"> <a href="#" class="btn btn-large btn-danger" rel="popover" data-content="And here's some amazing content. It's very engaging. right?" data-original-title="A Title">Click to toggle popover</a> </div> </div> </div>JSfiddle
However it isn't working. What am I doing wrong?
最满意答案
我通过做两件事来做到这一点:
由于Popover依赖于Tooltip,因此请确保bootstrap-tooltip.js包含在bootstrap-popover.js之前。
用$('.container a').popover();这样的行激活插件$('.container a').popover();
要在顶部弹出a标签添加data-placement="top" 。
I got it to work by doing two things:
As Popover relies on Tooltip, make sure bootstrap-tooltip.js is included before bootstrap-popover.js.
Activate the plugins with a line like $('.container a').popover();
To have the popup at the top add data-placement="top" to the a tag.
更多推荐
发布评论