I am using twiiter-bootstrap’s tooltip and I want to fire an ajax request, or lets say an alert box when the tooltip closes. The jquery code is :
$(document).ready(function(){
$('#explore').tooltip({
content : "hi there",
placement : 'bottom',
});
});
I have also tried other plugins like jquery’s tooltip and craigworks’s qtip but I cant figure out a way to fire a callback when a tooltip is closed.
Even if tooltip cant support this, can I use something else like bootstrap’s popover or some other workaround?
What I am trying to achieve is this:
I have a div with a button in it. If a user clicks that button, a small dialog appears next to the button that asks for some other information. The user can
(1)either ignore it and click anywhere else on the screen to close the dialog
(2) close the dialog by clicking on the ‘close’ button
(3) submit the answer to the question to close the dialog
In all the 3 cases, I want the div to be replaced by a another ajax-fetched content.
If tooltip had a callback, that would have been nice.
I was able to resolve this using Craig’s qtip using the
eventsproperty of the plugin :Any function listed in
events:hideproperty fires when the qtip closes. Resolved by Craig here.