Bootstrap Popover父母? [英] Bootstrap Popover parent?

查看:89
本文介绍了Bootstrap Popover父母?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆