javascript - Autoscrolling after page refresh doesn't work -
i'm trying automatic scrolling left side of horizontal website after refresh (like pressing f5). trying scrollleft()
, got nothing. window.scrollto(0,0)
working button this:
function scrollwindow() { window.scrollto(0,0); }
and
<input type="button" onclick="scrollwindow()" value="scroll" />
this works, doesn't $(document).ready(function());
:
<script> $(document).ready(scrollwindow()); </script>
i found in question top answer:
$(document).ready(function(){ $(this).scrolltop(0); });
but didn't work me. can me problem?
try this:
$(document).ready(function(){ scrollwindow(); });
Comments
Post a Comment