动态qtip不加载jquery sparkline图

时间:2011-01-13 18:25:58

标签: jquery

我将值存储在JQuery.data方法中,并且在输入旁边成功放置了带有迷你图(http://omnipotent.net/jquery.sparkline/)的div。我想将这些迷你图放在输入的提示中。提示出现并且似乎调整为图形的大小,但提示为空,没有任何显示。

非常感谢任何帮助。

谢谢,

罗布

代码已更新

我添加了$ .sparkline_display_visible(),现在部分显示了图表。现在出现了迷你线的下半部分。我试图在div中添加填充或边距,但只显示图形的一半底部?

$(“input”)。each(function(){

var theinput = $(this); var newValue = $(theinput).data(“Data”)

if($(newValue)。length){    var theclass = $(theinput).attr('class');     // alert(theclass +'='+ newValue.theValue);

theclass ='rob_'+ theclass

var theplaceholder = $(theinput).after(''+ newValue.theValue +'');    var myvalues = [newValue.theValue,thetotal];    $('。'+ theclass).sparkline(myvalues,{type:'pie',offset:'+ 90'})。attr('title',newValue.theValue +'of'+ thetotal);

$(theplaceholder).qtip({    
prerender: true,                                
content: $('.' + theclass),
show: { ready: true },
style: { name: 'cream', tip: true, padding: '10' }              
});
$.sparkline_display_visible()  

$( '画布,跨度')的CSS( '溢出', '可见');

$( '[类^ = qtip]')的CSS( '溢出', '可见');

}

});

更新
在Firebug中,我发现sparkline图形的画布设置为overflow:hidden,这是FireFox 3.6x的已知错误。

我更新了上面的代码,它在Internet Explorer中完美运行(令人惊叹的LOL)。 FireFox有什么问题吗?

1 个答案:

答案 0 :(得分:0)

当qtip可见时,你需要调用$ .sparkline_display_visible()方法。试试:

$('.' + theoriginalclass ).qtip({
   prerender: true,
   content: $('.' + theclass).html(),
   show: { ready: true },
   style: { name: 'cream', tip: true},
   onShow: function() { $.sparkline_display_visible(); }
});
相关问题