简体   繁体   English

如何将内容附加到Twitter-Bootstrap弹出窗口

[英]How to append content into a twitter-bootstrap popover

How can I append a ne DOM element into a bootstrap popover. 如何将ne DOM元素附加到引导弹出窗口中。 I have to render a small charts, using Highcharts, which should be displayed into popover, so I cant use just a string for content attribute. 我必须使用Highcharts绘制一个小的图表,该图表应显示在弹出窗口中,因此我不能仅将字符串用作content属性。

So the main problem is, how to get the popover element after $el.popover() was called. 因此,主要的问题是,在调用$el.popover()之后如何获取$el.popover()元素。

您必须启用弹出窗口实例的html选项,例如,

$('.popover-with-html').popover({ html : true });

You can do it with 你可以做到

$el.popover({
  content: $('.chart')
})

where .chart is your chart (or whatever) element. .chart是您的图表(或其他任何元素)元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM