I know a similar question has been asked and answered here - jQuery .scrollTop(); + animation.
I was trying to understand why if I try this-
$(window).animate({scrollTop:300},500)
The page does not scroll.
However, if I try the below one as suggested in an earlier SO question, it works fine -
$('html,body').animate({scrollTop:300},500).
What's more confusing is, if I just try the following (without any animation), it works fine -
$(window).scrollTop(300);
Can someone please help to understand what I am getting wrong here?