How to Fix: Animate scrollTop not working in firefox
The issue is caused by the browser's default scrolling behavior. To fix it, use the stop() method to pause the animation before starting it.
To fix the issue of animate not working in Firefox, you need to stop the animation before it starts. This can be achieved by calling $('body,html').stop(true,true) before animate. Here's how you can modify your code:
💡 Modified Code
$('body,html').stop(true,true).animate({scrollTop: stop}, delay);By doing this, you ensure that the animation is stopped before it starts in Firefox, preventing the double trigger issue.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Stuck in tutorial hell after 4 years: How do I b
Learn to build websites and think independently with coding skills.
How to Fix: Trying to sync mutliple audio tracks to a movie
Complex audio track synchronization can be challenging due to the larg
How to Fix: Failed to merge latest branches from upstream re
Update local repository with latest upstream branches.