What is the difference between:
window.scroll(0,200);
AND
$(window).scrollTop(200);
Apart from the fact that one of them is using jQuery and the other is not, what is the difference? Does one animate the scroll and the other doesn't? Will one work faster than the other?
.scrollTo() or .scroll() is applicable on window object while .scrollTop() works with any DOM element
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