I\'d like to add a timeout to this tooltip code so it only displays if the mouse hovers over it after a while rather than immediately... I tried adding the setTimeout()
var my_timer;
$('.mcTxb').hover(
function () {
my_timer = setTimeout(function () {
//do work here
}, 500);
},
function () {
clearTimeout(my_timer);
}
);
This will wait half a second before doing whatever when you mouseover
the element and the whatever will not happen if you mouseout
within the half second.