Popovers不适用于bootstrap?(Popovers don't work with bootstrap?)

编程入门 行业动态 更新时间:2024-10-26 06:30:29
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.

更多推荐

本文发布于:2023-07-24 00:30:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239310.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不适用于   Popovers   work   bootstrap

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!