...

View Full Version : Jump to Parent Anchor From Within iFrame Using Target



probey20
10-29-2007, 06:33 PM
Does anyone know how to put code on an included iframe which will cause the page to jump to a specific anchor point on the parent page? When I try the following, it only jumps to the top of the iframe and not to the top of the parent. I basically want it to scroll all the way to the top of the parent page as soon as the page loads.


window.location = "#top";

Thanks!

VIPStephan
10-29-2007, 06:48 PM
How about:


window.parent.location ="#top"

?

http://developer.mozilla.org/en/docs/DOM:window.parent

probey20
10-29-2007, 07:43 PM
That actually caused the iframe to break out of the parent, so that none of the parent is visible.

Mr J
10-30-2007, 12:29 AM
Give this a try

parent.scrollTo(0,0)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum