qTip (jQuery plug-in) how can I remove all qtips in my page?

后端 未结 10 1963
醉话见心
醉话见心 2021-02-04 00:30

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         


        
10条回答
  •  面向向阳花
    2021-02-04 01:13

    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.

提交回复
热议问题