Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Why is the scrolling function not working with Internet Explorer

Reply
Thread Tools

Why is the scrolling function not working with Internet Explorer

 
 
Stefan Mueller
Guest
Posts: n/a
 
      11-14-2005
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><b r><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><b r><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><b r><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><b r><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><b r><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><b r><br><br><br><br>
<input type = "input" name = "MyField" value = "">
</form>
</body>
</html>


 
Reply With Quote
 
 
 
 
BootNic
Guest
Posts: n/a
 
      11-14-2005


> "Stefan Mueller" <(E-Mail Removed)> wrote:
> news:dl8q7f$jqb$(E-Mail Removed)-plus.net....
>
> <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>


<script type='text/javascript'>
function AfterLoad() {
document.MyForm.MyField.focus();
setTimeout('window.scrollTo(0, 0)',1);
}
</script>

--
BootNic Monday, November 14, 2005 2:30 AM

Humor is just another defense against the universe.
*Mel Brooks*



 
Reply With Quote
 
 
 
 
Stefan Mueller
Guest
Posts: n/a
 
      11-14-2005
> <script type='text/javascript'>
> function AfterLoad() {
> document.MyForm.MyField.focus();
> setTimeout('window.scrollTo(0, 0)',1);
> }
> </script>


Great, this works perfect.

Many thanks
Stefan

PS: Do you think it's a bug or only a timing problem?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer 8: C:\Program Files\Internet Explorer\iexplore.exe vs C:\Program Files (x86)\Internet Explorer\iexplore.exe Nathan Sokalski Windows 64bit 16 02-22-2010 08:31 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
AOL working, Internet Explorer not working Paul Welch Computer Support 3 08-12-2006 11:29 PM
Internet Browser (Internet Explorer) Not Working MICHAEL SMITH Computer Support 12 04-22-2006 03:43 AM
Why is the scrolling function not working with Internet Explorer Stefan Mueller Javascript 0 11-14-2005 12:16 PM



Advertisments