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 8933189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:28:50+00:00 2026-06-15T09:28:50+00:00

I have a script that monitors scrolling and takes control of the scrolling to

  • 0

I have a script that monitors scrolling and takes control of the scrolling to animate the page based on certain parameters. To do this, it calls window.scrollTo(0, currentScrollTop); which perfectly interrupts the smooth scrolling in Firefox on Windows. I can then animate the page scroll to the place where I want it.

Unfortunately, this trick doesn’t appear to work in browsers in MacOS which results in a broken experience as JavaScript and the browser compete to scroll the window.

Is there a cross-browser way to stop smooth scrolling with JavaScript?

Site using effect in question: http://capitalismis.com

Relevant (simplified) code:

$doc.on('scroll', function(e)
    {
        $doc.off('scroll');

        window.scrollTo(0, $doc.scrollTop());

        var aniSpeed = 1500 * Math.abs(scrollTop - selected.top) / windowHeight;

        $body
            .stop()
            .animate({scrollTop: selected.top}, aniSpeed, 'easeOutQuad');
     }
);
  • 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-15T09:28:51+00:00Added an answer on June 15, 2026 at 9:28 am

    In short: don’t try to override native scrolling. Every OS and device handles things differently and it’s impossible to predict the different scenarios. There is “hard scrolling” (most Windows versions), “soft scrolling” (≈Mac OS X 10.6+) and browsers that only fire the onscroll event when the scrolling is completely done (iOS). It’s a mess.

    Instead of trying to modify the scrolling behavior of the body, I would modify the elements of the page accordingly. Listen to the onscroll-event, and move things around on the web page.

    // Capture scroll event
    $(window).scroll( function() {
    
        // Get scroll offset from top
        var scrollTop = $(window).scrollTop();
    
        // Use it to move elements around on the page (or change backgrounds etc.)
        // Here: move .element in the opposite direction of the scroll
        $('.element').css({
            '-vendor-transform' : 'translate3d(' + (scrollTop*(-1)) + 'px,0,0)'
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are creating a SaaS that monitors certain assets. This means it takes in
I have this script that run to fix my menu bar to the browser
I am essentially building a timer. I have a python script that monitors for
We have a script on an FTP endpoint that monitors the FTP logs spewed
So I have a python script that runs a loop in which it calls
I have a bash script that monitors the jobs in a cluster from the
I have a custom python script that monitors the call logs from a Nortel
Ok, so I have this PHP script that runs in a nice little infinite
I have objective-C code that calls ruby scripts and monitors STDOUT. However, ruby does
I have a Perl script that monitors any SNMP enabled service. The way it

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.