2013-01-19 136 views
1

Onmouse徘徊,酥料饼是只显示标题而不是图像Popover不显示图像?

代码:

<script type="text/javascript"> 
$(document).ready(function(){ 


var img ='<img src="/assets/Excel_1.png">'; 

$("#blob").popover({ title: 'Format for Excel sheet', content: img , trigger:'hover' }); 

}); 
</script> 

身体:

<i href="#" id="blob" class="icon-info-sign" rel="popover" style="margin-top: 300px"> </i> 

但不显示图像.....

谢谢

+0

Wh在错误,你在控制台上..? –

+0

这里没有任何关于ruby,rails或grails的信息;这是jQuery代码。 – sevenseacat

+0

我的意思是浏览器控制台.... –

回答

3

得到这个简单的问题的解决方案......

$("#blob_1").popover({ title: 'Format for Excel sheet', content: img , trigger:'hover',html: true }); 

就做出了这个改变需要的可能

谢谢..

0

请检查本教程并确保指定的图像输入正确的网址:

http://www.w3resource.com/twitter-bootstrap/popover-tutorial.php 
0

试试这个:http://jsbin.com/iducul/1/edit

HTML是:

<a href="#" id="example" class="btn btn-success" rel="popover">hover for popover</a> 

jQuery是:

$(function(){ 
    var img = '<img src="https://si0.twimg.com/a/1339639284/images/three_circles/twitter-bird-white-on-blue.png" />'; 
    $("#example").popover({title: 'Twitter Bootstrap Popover', content:img}); 
}); 
0

我想你的天堂” t关闭图像标签。可能这就是问题所在:

var img ='<img src="/assets/Excel_1.png">'; 

它应该是:

var img ='<img src="/assets/Excel_1.png"></img>';