I set a timeout with jquery in the scroll action. For example, after scrolling, wait 10 seconds and send an ajax request, but how to undo the previous timeout if you received a new scroll action with the first disconnected disconnected?
Use clearTimeout :
clearTimeout
var timer; $(window).scroll(function(){ if ( timer ) clearTimeout(timer); timer = setTimeout(function(){ // Make your AJAX request here... }, 10000); });
Source: https://habr.com/ru/post/1412266/More articles:heatmap graph with own color for some values ββin r - colorsJava Swing - the mouse pointer "moves" in the context menu when the JFrame maximizes - javaSaving multiple values ββfor one field in a database - sqlAdding hyphens to the main text? - objective-cJavascript sorting in alphabetical order corresponding to the beginning of a line, then in alphabetical order for contained text - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1412267/appending-n-elements-to-an-array&usg=ALkJrhjjXP8RLf7VX0lE2HosTLeHfju-SARun code when you reopen application - iosProblems with one magazine with in-app purchase - iosWix-Installer-How can I get the current setup.exe directory? - installerAnalyzing a Table Using the Html Agility Pack - c #All Articles