I am looking for a way to repeat the mouse action until the user moves away from the target. Mouseover calls the function once, I'm looking for a way to save the function.
Cheers, Gazler.
You 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); })
//continuous var timer; var doStuff=function(quit){ console.log('doing stuff'); if (quit!==true){ timer=setTimeout(doStuff, 100); } else{ clearTimeout(timer); } }; $('div#continuous').bind('mouseenter', doStuff).bind('mouseleave', function(){doStuff(true);});
Source: https://habr.com/ru/post/1725562/More articles:Coredata: import / export of objects from xml - cocoaORM library for automatically displaying foreign keys in Python or Ruby - pythonASP.NET ahead of time compilation - compiler-constructionHow to go to anchor tag in scrollable div without full browser transition? - javascriptHow to programmatically add WordPress links / bookmarks? - hyperlinkhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1725563/how-can-i-use-a-mac-address-to-get-a-gps-coordinate&usg=ALkJrhj10ubBMre2pQ_FqkO6yu5xXYgyewDisplay TON images with jquery - designSharepoint Public Blog Settings - sharepointC ++ templates and the ambiguity problem - c ++How to call a web service using XDocument? - c #All Articles