如何使用Twitter Bootstrap中的popover显示图像?(How do I use popover from Twitter Bootstrap to display an image?

编程入门 行业动态 更新时间:2024-10-17 17:29:22
如何使用Twitter Bootstrap中的popover显示图像?(How do I use popover from Twitter Bootstrap to display an image?)

Twitter Bootstrap的popover功能的典型例子是具有标题的类固醇的工具提示。

HTML:

<a href="#" id="blob" class="btn large primary" rel="popover" data-content="And here's some amazing content. It's very engaging. right?" data-original-title="A title">hover for popover</a>

JS:

<script> $("#blob").popover({offset: 10}); </script>

我想使用popover显示图像。 这可能吗?

The canonical example for Twitter Bootstrap's popover feature is sort of a tooltip on steroids with a title.

HTML:

<a href="#" id="blob" class="btn large primary" rel="popover" data-content="And here's some amazing content. It's very engaging. right?" data-original-title="A title">hover for popover</a>

JS:

<script> $("#blob").popover({offset: 10}); </script>

I'd like to use popover to display an image. Is this possible?

最满意答案

很简单 :)

<a href="#" id="blob" class="btn large primary" rel="popover">hover for popover</a> var img = '<img src="https://si0.twimg.com/a/1339639284/images/three_circles/twitter-bird-white-on-blue.png" />'; $("#blob").popover({ title: 'Look! A bird!', content: img, html:true });

http://jsfiddle.net/weuWk/

Very simple :)

<a href="#" id="blob" class="btn large primary" rel="popover">hover for popover</a> var img = '<img src="https://si0.twimg.com/a/1339639284/images/three_circles/twitter-bird-white-on-blue.png" />'; $("#blob").popover({ title: 'Look! A bird!', content: img, html:true });

http://jsfiddle.net/weuWk/

更多推荐

popover,title,HTML,Twitter,<a,电脑培训,计算机培训,IT培训"/> <meta name=&q

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

发布评论

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

>www.elefans.com

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