jQuery Qtip中的浮标? [英] Flot within jquery qtip?
问题描述
我正在尝试复制Amazon,Trip Advisor等正在做的事情,并在将鼠标悬停在平均评论得分上时显示工具提示类型的界面,以条形图格式显示得分的细分-在qtip论坛上,据说它使用Flot (我第一次使用它通常是使用google图表),但是当我将其放在工具提示之外时,尽管该图在页面上可以正常显示,但是只要将div放入其中,它就无法正常工作.
I'm trying to replicate what Amazon, Trip Advisor etc are doing and showing a tooltip type interface when hovering over an average review score to show the breakdown of scores in bar chart format - on the qtip forums it's said to use Flot (my first time using it as normally use google charts) but whilst the graph renders fine on the page when I take it outside of the tooltip, as soon as I put the div within it it doesn't work.
我的页面是: http://solicitor.info/demo/solicitors/?id= 15
任何人都可以看看我在做什么吗?
Can anyone please see what I'm doing wrong?
推荐答案
当我点击您的页面时,出现了JavaScript错误:
When I hit your page, I get a javascript error:
Uncaught Invalid dimensions for plot, width = null, height = null
我猜想它正在尝试渲染图,而占位符" div仍隐藏在qtip内.
I'm guessing it is trying to render the plot while the "placeholder" div is still hidden inside the qtip.
我会尝试将$.plot
调用移至qtip onShow 打回来.这样,您可以确保在尝试渲染图之前已显示div.
I would try moving the $.plot
call into a qtip onShow callback. That way you are sure the div is shown before trying to render the plot.
这篇关于jQuery Qtip中的浮标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!