I\'m using the jquery-plugin qTip. What\'s the command to destroy all tooltips in my page ?
I tried:
$(\'.option img[title], span.taxonomy-image-link-al
if ( jQuery( '.qtip' ).length > 0 )
{
jQuery( "#IdElement").qtip("destroy");
}
qTip2 is newer version of this script, but I would just like to point out 1 thing.
$(".qtip").remove();
This piece of code didn't destroy all the tooltips - it simply removed their containers. All the handlers and events attached to objects which invoked the tooltips are still avaiable in browser's memory.
In qTip to delete the tooltip and it's handler scompletely you would have to use:
$(mytooltip).qtip("destroy");
or
$(mytooltip).qtip('api').destroy();
In qTip2 however using this:
$(mytooltip).remove();
Would automaticaly call out the api and destroy tooltip and it's handlers completely.
Looks buggy. I've had some luck with this, but it does not restore the original titles. I suspect destroy
doesn't do that either...
$('span.taxonomy-image-link-alter img')
.filter(function(){return $(this).data('qtip');})
.qtip('destroy');
It seems you cannot call destroy
on elements without qTip - it doesn't fail silently, but throws an exception and stops the loop.
What about:
$('[data-hasqtip]').qtip('destroy', true);
Seems to be working with qTip2
version 3.0.2
.