2011-01-13 105 views
0

我有存储在JQuery.data方法中的值,并成功地在输入旁边放置带有迷你图形(http://omnipotent.net/jquery.sparkline/)的div。然后,我想将这些迷你图放置在输入提示中。提示出现,并似乎调整大小的图形的大小,但提示是空的,没有出现。动态qtip不加载jquery迷你图

任何帮助将不胜感激。

感谢,

罗布

代码更新

我加$ .sparkline_display_visible()现在的图形部分出现。现在出现火线的下半部分。我试图添加填充或边距的div,但只有图的一半的底部出现?

$( “输入”)每个(函数(){

变种theinput的= $(本); 变种NEWVALUE = $(theinput的)。数据( “数据”)

如果( $(newValue)以。长度){ VAR theClass描述= $(theinput的).attr( '类'); // 警报(theClass描述+ '=' + newValue.theValue);

theClass描述= 'rob_' +该类别

var theplaceholder = $(theinput).after(''+ newVal ue.theValue +''); var myvalues = [newValue.theValue,thetotal]; ('。'+ theclass).sparkline(myvalues,{type:'pie',offset:'+90'})。attr('title',newValue.theValue +'of + thetotal); ('canvas','span')。css('overflow','visible'); ('[class^= qtip]')。css('overflow','visible');

}

});

更新
从内萤火我发现,火花线图的画布设置为溢出:隐藏这是与Firefox 3.6已知错误。

我更新了上面的代码,它在Internet Explorer(令人惊叹的LOL)中完美工作。有没有修复FireFox的问题?

回答

0

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

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

喜加雷斯,想你的建议,并没有奏效。我甚至在将qtip与sparkline连接到课程之前添加了setTimeout,并且它不起作用。嗯。 – Rob 2011-01-14 14:50:56