jquery on scroll down

Check current scrollTop vs previous scrollTop

var lastScrollTop = 0;
$(window).scroll(function(event){
   var st = $(this).scrollTop();
   if (st > lastScrollTop){
       // downscroll code
   } else {
      // upscroll code
   }
   lastScrollTop = st;
});

4
7
Awgiedawgie 440220 points

                                    Syntax
Trigger the scroll event for the selected elements:
$(selector).scroll()

Attach a function to the scroll event:
$(selector).scroll(function)

4 (7 Votes)
0
3.67
6
Awgiedawgie 440220 points

                                    $("#main-div" ).on( 'wheel', function() {
   alert("Hello! I am an alert box!!");
});

3.67 (6 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
div scroll event jquery jquery click scroll down scroll down page using jquery scroll down by jquery scroll on element jquery window scroll up or down using jquery on scroll page jquery window on scroll function jquery on scroll on div jquery wheel mouse click jquery event scroll down scroll up jquery jq on scroll click to scroll down jquery mouse wheel function jquery jquery on scroll up and down event jquery on scroll event function jqueyr on scroll jquery scroll up or down jquery when scroll down how to page scroll down in jquery click and scroll to down jqueyr onscroll down jquery jquery on click scroll down jquery scroll down on click jquerry scroll down scroll down using jquery jquery scroll up and down scroll down jquery id window scroll down event jquery scrolling down with jquery scroll down on click jquery set scroll down jquery on click scroll down jquery jquery scroll down page jquery on scroll down event scroll down in jquery scroll down javascript jquery trigger mouse wheel event in jquery mouse wheel event jquery wheel event in jquery div scroll down event jquery jquery on html scroll on div scroll jquery how to scroll down with jquery div scroll down jquery click scroll down jquery jquery on scroll up and down section scroll jquery scroll down and scroll up jquery jquery if scroll down on scroll do jquery jquery function on scroll on scroll event in jquery make website scroll down with jquery scroll down with jquery div scroll event in jquery how to scroll down in jquery jquery on(scroll) page scroll event jquery scroll to down in jquery jquery detect scroll up or down javascript scoll function window.scroll jquery deprecated jquery event on scroll down jquery on scroll add items to list js scroll function load function on scroll jquery jquery scrollable detect type on mouse scroll js scroll even in jquery jquery bind scroll event on div ijquery if window or element is scrolled $(window, "main").on("scroll" jquery scroll event listeners scrollabel div jquery if mouse scroll down and up detection jquery window scroll up jquery jquery onscroll type text jquery document on scroll jquery on csroll detect window scroll jquery jquery scroll.js jquery js scroll div on scroll add css jquery each scroll function call javascript each scroll function call scroll jqery scrollDown in jquery jquery trigger on scroll to element jquery scrolling down scroll length jquery jquery on scroll function jquery detect scroll toggle action on first scroll jquery how to check for scroll down jquery scroll up and down events scroll using a function How can I determine the direction of a jQuery scroll event? on scroll down jquery window onscroll jquery scroll track jquery how to hold scroll while scrolling in jquery jquery event scroll down jquery page scroll jquery scrollevent detect user scrolling down jquery define when scroll over javascript jqeury onscroll on stop scroll jquery scroll up event how to detect on ScrollUp if scroll down to up check injqery on document scroll jquery check scroll jquery jquery onscroll element listener document scroll function jquery add scroll page jquery jquery window scrollup @include scroll() jquery scroll detect how to check scroll up or down jquery when on the top of the page in scroll event jquery jquery on scroll call function scroll to the end then execute jquery on scroll call function event on scroll up jquery scoll event scroll data inside a div jquery scroll jquery event scroll jquery after 1 scroll jquery on scroll down event in jquery detect position scroll jquery mouse scroll event jquery if window scroll jquery jquuery scroll down .onscroll jquery event on page load how to full scroll down using jquery if scroll down jquery scroll top jquery scroll fuction in java html scrollheight jquery alert on scroll down jquery Scroll Up using jquery jquery wheel event page scroll in jquery jquery detect way of scroll scroll functions java script jquery scroll sow window scroll up event onscroll event in jquery jq window scroll how to listen for scroll down in jquery detect scroll up and down jquery on scroll function in javascript check win scroll up jquery dom mouse scroll jquery no scroll get scroll direction jquery Call a function on each scroll down in jquery jquery div on scroll jquery check page scroll j query allow a div to scroll jquery indicate scroll jquery window.scroll jquery scroll class $(window).on("scroll" mouse scroll javascript writing a function in javascript scroll jquery page on scroll event jquery page scroll event $(window).scroll( call function on scroll div javascript dteetct if scrolling or not jquery js-scroll-trigger jquery jquery scroll down jquery overflow scroll call a function on scroll down of document in jquery jquery event on scroll jquery event on click and scroll on scroll up scroll on click jquery jquery $(window).scroll({ scroll trigger to on scrollbar jquery purpose of jquery.scrolly Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element. when scroll down jquery wheel display javascript jquery how to make scroll happening on click jquery scrollintoView how to mouse wheel control false after last child in jquery on window scroll jquery jquery window scroll direction jquery scroll function if scrolled up function scroll jquery on div how to get scroll handler width jquery how to get get scroll handler width jquery get scrollhandler width jquery get scroll handler width jquery on mouse scroll javascript jquery scrollable div html scroll wheel scroll down jquery add on scroll on div jquery find div class on scroll jquery jquery add scroll eventllistenener window scroll down jquery js mouse escroll jquer window on scroll jquer documet on scroll how to listen for scroll with jquery\ om scroll jquery handle scroll by user jquery jquery scroll event listener window scroll function jquery scroll tutorial scroll down event jquery jquery scrool up down get scroll event jquery div get scrolling up and down jquery jquery 3 scroll deprecated javascript function for scrolling div scroll jquery jquery scrollarama jquery scroll div wheel event jquery jquery scroll pont capture event click scroll event jquery event on scroll jquery on('scroll') jsqury on scroll on('scroll" trigger function on scroll call a function when a section on scroll in jquery jquery scroll of jquery scrolling js fire event on div scroll jquery scrolling event listener jquery scrolling event event listener for scroll in jquery jquery eventlistener in scroll this.scrollY jquery window .scroll jquery give x scroll for single div jquery jq after scroll jquery .on scroll jq scroll jquery detect mousewheel when over a div scroll jquery event page scrolling jquery jquery on scroll\ jquery oncroll jquery .scroll in javascript on wheel jquery. jquery sc jquery script scroll jquery window.scroll syntax scroll div jquery j query window.onscroll function scroll jquery jquery at scroll something apear how to get scroll event in jquery scroll func scroll funtion in jquery mouse scroll event in jquery why is my content scrolling jquery scroll function js add scroll event listener to div jquery jquery when scrolled global .on scroll jquery window.scroll deprecated evento de scroll jquery j query on scroll run function on scroll go to div event jquery scroll jquery down body scroll jquery scroll event for div jquery detect mouse scroll down onscroll event on div class function on scroll listen for vertical scroll jquery listen for vertical scroll scroll jquery listen for scroll jquery jquery document scroll hqury on scroll on scroll in jquery jqeury scroll listener jquery scorll event scroll function watch scroll jquery javascript div scroll event detect mouse wheel scroll javascript jquery page slide down eventlistener jquey scroll div js function on scrolling jquery activate scroll jquery scroll document jquery on click view more with scroll on wheel down jquery when scroll jquery jq on sc roll ignet class jquery scroll method jquery on scroll down jquery wheel jquery scrolY jQuery update dom on scroll document scroll jquery scroll with mouse jquery jquery window scroll event if document scrolled to id section in jquery jquery on scroll y jquery add event listener scroll on scroll function make a div scroll jquery call function on scroll jquery jquery force an element to scroll on mouse scroll call function on scroll javascript jquery mouse scroll auto selecte scroll() jquery scroll to div complete event scrol event jquery jquery event scroll scroll function in javascript javascript function scroll jquery on window scroll jquery onscroll event listener get scroll; wheel input in js on scroll jquery onscroll function jquery onscroll 200px div on scroll jquery .on scroll function to run when scrolled javascript jquery onscroll event .Scrollable() windows.scroll to w3schools jquery on scroll page jquery on scroll element javascript on mouse scroll browser window javascript trigger event when scroll to div javascript event scroll control scroll bar jquery scroll function javascript jquery scroll wheel scroll javascript call function jquery window scroll is deprecated jquery scroll event LIST scroll end jquery jquery mouse events example wheel scrolling menu event jquery scrolling event jquery jquery scrolling jquery scroller window.scroll is decpeated jquery jquery scroll listener body scroll function jquery on wheel event jquery mouse scroll event jquery div scroll event scroll body on load jquery $(window).scroll(function () jquery windows scroll jquery scoll jquery on page scroll jquery scroll scrollview page scroll jquery scroll function in jquery javascript call function on scroll jquery .scroll jquery bind scroll scroll function jquery scroll timing jquery window.addEventListener('scroll', function(e) { jquery jquery add scroll no add scroll jquery jquery window on scroll bind scroll event how to control button on scroll in jquery jquery scrollbar callback scroll window done jquery jquery event handler scroll wheel jquery debuobt scroll event scroll in div effect jquery on scroll event jquery scroll func jquery on sroll jquery jquery scroll events element scroll jquery window on scroll jquery document.scroll jquery trigger events by scrollcss when i scroll in jquery jquery scroll down event on scroll js on scroll jquery event onscroll event jquery jquery on scroll event jquery effect div scroll up window scroll event jquery scroll event jquery how to enable scrolling in html using jquery .scroll jquery scroll listener jquery jquery target page scroll addeventlistener scroll jquery jquery div scroll html run code on scroll jquery bind to scroll all options of scroll scroller jquery javascript scroll event jquery add scroll jquery all scroll events jquery all scroll event onscroll jquery trigger function on scroll javascript jquery fun function when scroll to element javascript run function on scroll function if on scroll javascript jquery scrojol event jquery event listener scroll html scroll function jquery on scoll jquery when you scroll post a div window.scroll jquery window.onscroll jquery how to use the scroll function in javascript document on scroll jquery jquery mouse scroll evento scroll jquery do while jquery scrolling jquery scroll example window scroll jquery on scroll jquery scroll is not working on js jquery for body scroll window.scroll in jquery Jquary event if page is scrolled scroll jquery jquery onscroll jquery scroll event jquery scroll 25% javascript function on scroll run a function on scroll javascript jquery window scroll jquery capture scroll windows scroll jquery on page scroll jquery jquery on boody scroll how to trigger a element on scroll down javascript jquery scroll j query scroll CSS scroll event for a class CSS scroll event for div on scrall jquery scroll in jquery jquery on scroll
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source