$(document).ready(function(){
$("#right_arrow").click(function(e) {
var scrollleftvar = $(window).scrollLeft();
e.preventDefault()
$("body").scrollLeft(scrollleftvar + 50);
});
});
Hi, Im trying to animate or ease the incremental scroll eleft triggered above, but struggling a little, any help would be really appreciated, thank you
You can use the .animate()
-function:
$('body').animate( { scrollLeft: '+=50' }, 1000, 'easeOutQuad' );
+=value
or -=value
to animate from the current value (like an offset).See the jQuery-Docs: ".animate()" for more informations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With