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

后端 未结 10 1916
醉话见心
醉话见心 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 00:56

    qtip("destroy") is buggy (version 2.1.1) and doesn't clear everything.

    I found this as a proper workaround:

    // don't call destroy if not needed
    if (element.data("qtip")) {
        // the 'true' makes the difference
        element.qtip("destroy",true);
        // extra cleanup
        element.removeData("hasqtip");
        element.removeAttr("data-hasqtip");
    }
    

提交回复
热议问题