admin管理员组文章数量:1356413
I'm using qTip2 here, and need the ability to refresh the content of the tooltip while it is still active. The elements with the tooltip have a click event that does some calculations that can change what I want to be displayed in the tooltip.
I have tried calling the 'destroy' method and rebinding the qtip2 after each recalculation, and it works but only after moving the mouse away and bringing it back.
What I want to achieve is to force the currently active tooltip to redraw itself.
I'm using qTip2 here, and need the ability to refresh the content of the tooltip while it is still active. The elements with the tooltip have a click event that does some calculations that can change what I want to be displayed in the tooltip.
I have tried calling the 'destroy' method and rebinding the qtip2 after each recalculation, and it works but only after moving the mouse away and bringing it back.
What I want to achieve is to force the currently active tooltip to redraw itself.
Share Improve this question edited Apr 25, 2012 at 16:31 Neysor 3,90511 gold badges36 silver badges66 bronze badges asked Jul 26, 2011 at 1:00 andrewandrew 731 silver badge3 bronze badges1 Answer
Reset to default 8If you look in the documentation, there is a "set" method to change the content:
$('.selector').qtip('option', 'content.text', 'new content'); // Preferred
Is that what you're looking for?
Update: After testing out the api options, they seem to not be working properly, but I've found another method - here is a demo - hover over the tip for 1 sec to see it change.
// make sure you target a specific tip
var qapi = $('#tip1').data('qtip'),
newtip = 'new tooltip content'
qapi.options.content.text = newtip; // update content stored in options
qapi.elements.content.text(newtip); // update visible tooltip content
qapi.redraw(); // redraw to adjust tooltip borders
本文标签: javascriptqTip2refresh tooltip while it is activeStack Overflow
版权声明:本文标题:javascript - qTip2 - refresh tooltip while it is active - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744065547a2584922.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论