How to hide the qtip prompt after a while?
I am using qtip ( http://craigsworks.com/projects/qtip/ ) to create tooltips. Now I need to show the tooltips when the button is clicked and hide the tooltips for example when 3 seconds have passed. My current code doesn't work, hints sometimes go away and sometimes stay ...
var self = $("#email");
self.qtip( {
content: error,
tip: true,
position: { corner: { target: 'rightMiddle', tooltip: 'leftMiddle' } },
style: 'error',
show: { when: false, ready: true },
hide: { when: { event: 'mousemove' }, delay: 2000, effect: function() { self.qtip("destroy"); } }
} );
+2
source to share
1 answer
@newbie, but the answer is, is to clean up the code and maybe that's the problem. for example, replacing the variable name "self" with "this".
$("#email").qtip( {
content: error,
tip: true,
position: { corner: { target: 'rightMiddle', tooltip: 'leftMiddle' } },
style: 'error',
show: { when: false, ready: true },
hide: { when: { event: 'mousemove' },
delay: 2000,
effect: function() { $(this).qtip("destroy"); }
}
});
+3
source to share