Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip not disappearing

I have jQuery tooltip activated for all elements in my page. One of those elements is an AJAX 'Submit' button that is immediately disabled (on click) and then vanishes (the div containing it is overwritten by the AJAX response)

My problem is that the tooltip continues to remain on screen even after the button is clicked/vanishes. Have tried these codes, but to no use (no all together, but any one):

$("#signup").tooltip({events: {input: 'click, blur'}});
$("#signup").tooltip("disable"); 
$("#signup").tooltip().hide(300);
$("#signup").tooltip("close");

Followed by

document.getElementById('signup').disabled=true;

And then the Ajax call.

like image 308
S R Avatar asked Oct 09 '13 08:10

S R


2 Answers

You can use remove() to remove the tooltip

 $(".ui-tooltip-content").parents('div').remove();
like image 177
Donovan Charpin Avatar answered Sep 19 '22 15:09

Donovan Charpin


I know it's an old question but I ran into the same problem where i delete the element but the tooltip does not disappear so i used the following way to solve it.

Let's say you used this to initiate the tooltips:

$('document').tooltip({
    position: {
        my: "center bottom-15",
        at: "center bottom"
    }
});

The following removes the tooltip after a click from the DOM.

$( document ).click(function() {
   $('.ui-tooltip').remove();
});

Hope this help and other people!

like image 26
NIppun Avatar answered Sep 22 '22 15:09

NIppun