0

I literally just comment out this line and the page loads without scrolling to the bottom:

jQuery(map_input).appendTo(container);

jQuery(map_input).focus();

Am I missing something? The field does focus but the page loads and scrolls to the bottom.

Edit: I'm using jQuery 1.4.4

The input field is above the fold, although I'm loading the input field after the page is loaded

AlxVallejo
  • 3,066
  • 6
  • 50
  • 74
  • 1
    Isn't this the expected action if you focus an input that isn't in view? Where is `#input-search-by-zip` located on your page? – Joe May 25 '14 at 17:29
  • It's above the fold, but I'm loading a map and then appending an input to it, see my edit – AlxVallejo May 25 '14 at 17:32
  • 1
    It's happening to move the focused element into the viewport. Check out http://stackoverflow.com/questions/4898203/jquery-focus-without-scroll – Mario May 25 '14 at 17:33

0 Answers0