Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9029821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:20:16+00:00 2026-06-16T07:20:16+00:00

If i want to bind an event on page scrolling i can use scroll();

  • 0

If i want to bind an event on page scrolling i can use scroll();.

But how to fire when scroll() is ended up?

I would like to reproduce this:

   $(window).scroll(function(){
    //do somenthing
    });

    $(window).scrollSTOPPED(function(){  //--> when i'm scrolling then i stop to scrolling (so NOT when page scrollbar is at the end top or bottom :)
    //do somenthing else
    });

any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:20:18+00:00Added an answer on June 16, 2026 at 7:20 am

    tiny jquery way

    $.fn.scrollStopped = function(callback) {
      var that = this, $this = $(that);
      $this.scroll(function(ev) {
        clearTimeout($this.data('scrollTimeout'));
        $this.data('scrollTimeout', setTimeout(callback.bind(that), 250, ev));
      });
    };
    

    After 250 ms from the last scroll event, this will invoke the “scrollStopped” callback.

    http://jsfiddle.net/wtRrV/256/

    lodash (even smaller)

    function onScrollStopped(domElement, callback) {
      domElement.addEventListener('scroll', _.debounce(callback, 250));
    }
    

    http://jsfiddle.net/hotw1o2j/

    pure js (technically the smallest)

    function onScrollStopped(domElement, callback, timeout = 250) {
      domElement.addEventListener('scroll', () => {
        clearTimeout(callback.timeout);
        callback.timeout = setTimeout(callback, timeout);
      });
    }
    

    https://jsfiddle.net/kpsxdcv8/15/

    strange fact

    clearTimeout and clearInterval params don’t have to be defined and can even be wrong types or even omitted.

    http://jsfiddle.net/2w5zLwvx/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The documentation says to use: $(input[type='checkbox']).bind( change, function(event, ui) { But I want to
I want to bind a function to an event but I want to change
Let's say we want to bind an event listener on a page other than
I have bind an event on submit form on a login page. I want
I want to bind an event to a certain class and ID for when
I want to bind a click event with the element: $('a').click(function(){ btn_submit_pressed=false; }); Now,
jsFiddle demo link Hi Guys, I want to bind the keypress event handler when
I want to be able to bind a single and double click event to
I want to bind a string value to a text box but only if
is there anyway to ease my page scroll? I'm doing a horizontal page scrolling.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.