2011-01-13 49 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