Bootstrap Popover父母? [英] Bootstrap Popover parent?
问题描述
我正在尝试将popover插入到特定元素中,因为目前,popover正在直接插入< body>
(和我需要它相对于其他一些元素)。但是,我似乎无法找到如何将popover插入某个元素?如何触发此操作?
I'm trying to get a popover to be inserted into a specific element, since at the moment, the popover is being insert straight into <body>
(and I need it relative to some other elements). However, I can't seem to find how to get the popover to be inserted into a certain element? How can I trigger this?
编辑:我发现在放置选项中使用inside会将其插入触发它的元素中。这很接近,但我需要一种方法在DOM中将它插入更高的位置。
I have found that using "inside" in the placement options will insert it into the element that triggered it. This is close, but I need a way to insert it a bit higher up in the DOM.
推荐答案
您可以更新工具提示.js到这个文件 - 我的tooltip.js 和然后通过添加 data-container =。element
或使用javascript
You can update your tooltip.js to this file - my tooltip.js and then select the the element you want to the popover to be appened to by either adding data-container=".element"
or with javascript
$(元素).popover({container:'。popover-holder'})
这篇关于Bootstrap Popover父母?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!