0

I just installed a script to focus at my first input field, which is toward the footer. The focus works great, but the page scrolls to the bottom after loading.

Can I still use the focus and stop the page from scrolling down to the first input field?

http://www.ubspack.com/

Sophie Alpert
  • 139,698
  • 36
  • 220
  • 238
Erik
  • 5,701
  • 27
  • 70
  • 119

2 Answers2

2

Insert this at the end of the page:

 <script type="text/javascript">
 window.scrollTo(0, 0);
 </script>

This will again scroll the page to the top.

shamittomar
  • 46,210
  • 12
  • 74
  • 78
-4
$(function(){
     $("input").focus();
     $('html, body').animate({scrollTop:0}, 'slow'); 
});)
Ayaz Alavi
  • 4,825
  • 8
  • 50
  • 68