Why is the scrolling function not working with Internet Explorer



I'd like to set the focus to a field which is quite at the bottom of my
page. But I'd like that the page is shown at the top. If you press a key the
page should scroll down to the field.
In Mozilla and Opera the following code works fine. But why isn't it working
with the Internet Explorer?

Stefan

PS: If I don't set the focus to the filed I can scroll with
window.scrollTo(0, 20);
to every place where I'd like to also with the Internet Explorer.

========================================

<html>
<script type = 'text/javascript'>
function AfterLoad() {
document.MyForm.MyField.focus();
window.scrollTo(0, 0); // Supposed to be scrolling to the top of
the page
}
</script>

<body onLoad = "AfterLoad()">
<form name="MyForm">
Top Row
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<input type = "input" name = "MyField" value = "">
</form>
</body>
</html>


.



Relevant Pages

  • SP4 problems with internet explorer
    ... I just did an update to internet explorer from msupdate, ... Just blank pages that say "done" at the bottom left corner. ... Prev by Date: ...
    (microsoft.public.win2000.windows_update)
  • Re: unsubscrib
    ... YongYong Li wrote: ... Scroll to the bottom to see where you can unsubscribe. ... Prev by Date: ...
    (comp.lang.python)
  • AI cabs on sale
    ... $300 USD. ... http://www.acousticimg.com/mailings/newsletter.html (scroll to the ... bottom). ... Prev by Date: ...
    (rec.music.makers.guitar.jazz)
  • Re: Posting at Work?
    ... <snipping content for those who get annoyed by having to scroll down ... to see the few new lines added to the bottom of the post> ... Prev by Date: ...
    (rec.arts.sf.tv.babylon5.moderated)
  • Re: Failure to maintain one lane
    ... >Yeah, well, that's what happens when we post at the bottom. ... no one would have to scroll at all... ... Prev by Date: ...
    (rec.autos.driving)