I am looking for a way to repeat a mouseover action until the user moves away from the target. A mouseover invokes a function once, I am looking for a way to keep doing the function.
Cheers, Gazler.
You'll need to use setInterval():
setInterval()
var to; var doStuff = function() { console.log('doing stuff...'); }; $('a').hover(function(e) { to = window.setInterval(doStuff, 1); },function(e) { window.clearInterval(to); })
2.1m questions
2.1m answers
60 comments
57.0k users