I want to show a tooltip which will disappear after 3 seconds time.
How should I modify my code? seems commented code will not work:
http://jsfiddle.net/sMJ2
You can do it like this:
$(function () {
$('#mytooltip').tooltip();
$('#mytooltip').tooltip({
open: function (e, o) {
$(o.tooltip).mouseover(function (e) {
$('#mytooltip').tooltip('close');
});
$(o.tooltip).mouseout(function (e) {});
},
close: function (e, o) {},
show: {
duration: 800
}
});
$('#mytooltip').tooltip('open');
setTimeout(function () {
$('#mytooltip').tooltip('close'); //close the tooltip
}, 3000); //but invoke me after 3 secs
});
Fiddle.