Reputation: 8640
As you can see in image first gray button is clicked and than I put mouse on last button it hovers the Tooltip. Both are showing at the same time.
Once the button is clicked tooltip will not disappeared until you on click something else.
I have lots of tooltip in document so I am using this.
$( document ).tooltip()
I tried this for removing tooltip but doesn't work.
$( document ).tooltip().click(function() {
$(document).tooltip( "close");
});
Also I tried to put some hidingToolTip function on onClick event of each element and it works fine. but I need a generalize solution.
Upvotes: 2
Views: 2565
Reputation: 97
If you initialize the tooltip using:
$('[data-toggle="tooltip"]').tooltip();
Then you can use the following code to make them fade out after a click:
$('[data-toggle="tooltip"]').click(function() {
$('.tooltip').fadeOut('fast', function() {
$('.tooltip').remove();
});
});
Upvotes: 4
Reputation: 221
You have to remove tooltip DOM element(s) everytime when you fire a new tooptip e.g.
$(element).click(function() {
$('.tooltip_element').remove();
// show new tooltip.
});
Upvotes: 0