craigsworks.com - Support Forum

Full Version: How to refer given instance of qTip
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I really like you plugin, it's great work.
I am working on an animation written in jQuery and I want to use qTip as a kind of chat bubbles (like in comix).
There are some characters, man and woman, and i want them to talk to each other via chat bubbles.
Example link is here: http://hai.cz/test/.

What I want is some way how to refer a given chat bubble. There will be more than one chat bubble, and I need to update them dynamicaly. Is it possible to set ID on creation time? Or how to refer to qTip instance ?

thank you for your reply.
David
PS: hover the woman picture to see chat bubble...
Ok, I think I have found the way... Smile

First create the tooltip,
then refer it via jQuery like this: var myQtip = $('.qtip:last');
from now on I use myQtip variable to access it.
When I create other tooltips, i use the same approach -> the newly created qtip instance should always be the ':last' one from jQ point of view.

To update the text content i dont use API (did not figure out how to use it), but simplty this:
myQtip.find('.qtip-content').text(getRandomText());
David,

Seems you figured it out on your own, but I would say to use the updateContent API method for updating the qTip contents, otherwise you may get some odd positioning issues arising. You can do this by referring to the api like so:

JS Code
myQtip.qtip('api').updatePosition();


Hope this helps.
craig Wrote:David,

Seems you figured it out on your own, but I would say to use the updateContent API method for updating the qTip contents, otherwise you may get some odd positioning issues arising. You can do this by referring to the api like so:

JS Code
myQtip.qtip('api').updatePosition();


Hope this helps.

Thank you for your reply. Now it is clear to me how to use the API Smile I was using it wrong way and it did not work. I will try out the suggested way. Thanks
Reference URL's