PDA

View Full Version : Javascript to ensure top of the page appears in iFrame



need_help
09-20-2007, 08:55 PM
Hello

I have a webpage with an IFRAME in it and it contains a form where you have to go through 7 steps by answering questions and clicking next. Upon click the page stays where it was left off and doesn't go back to top of the page. Is there javascript code to ensure that top of the page to appear?

Also, do i have to put the code in the parent page code? or in the link which the IFRAME points to?

Please help!
Thanks

djr33
09-20-2007, 09:09 PM
javascript:window.scrollTo(0,0)

For example, <body onLoad="window.scrollTo(0,0);">

need_help
09-20-2007, 09:25 PM
I will try this. Thanks!!

need_help
09-24-2007, 02:45 PM
Hello
The code didn't work... Any idea why? It just doesn't bring the page to the top... Please help!