Amar
Amar

Reputation: 1936

Hiding jQuery-ui tooltip which is manually opened

I'm using jquery tooltip and at some point am manually showing the tooltip by using this code:

$("#div").tooltip( "open" );

After that if i do mouse click on somewhere else in the document means that tooltip is not hiding, its still there in the view, is there any way to hide that tooltip other than using the close method as follows.

$("#div").tooltip( "close" );

Upvotes: 1

Views: 210

Answers (2)

Foreever
Foreever

Reputation: 7468

I believe this could solve your problem. Please give your feedback on this.

   $('body *:not(#div)').on{'touchstart', function(){
        $("#div").tooltip( "close" );
        }
    }

Upvotes: 0

gcpdev
gcpdev

Reputation: 459

If you want to close any div tooltips opened in the whole document, with a single click, you may try:

$(document).click(function() {
  $("div").tooltip("close");
});

I'm sure that this is not the best way, but you'd give a little description of what you're doing, so I'm suggesting this based on your needs (close tips by clicking anywhere).

Upvotes: 2

Related Questions