<< All Posts
How to scroll window to the left or right using jQuery


I’m posting this information because I spent some hours to make this working fine in Firefox and Safari. We can find on google a lot of examples to scroll window or div elements up or down. But left or right isn’t so easy.

<script type="text/javascript">  
                $("#moveLeft").click(function() {
                    $("html, body").animate({ scrollLeft: '-=500px' }, "slow");

                $("#moveRight").click(function() { 
                    $("html, body").animate({ scrollLeft: '+=500px' }, "slow");

<< All Posts


🇧🇷 🇨🇦
Runs on OpenBSD 🐡