robertalord Posted June 16, 2009 Share Posted June 16, 2009 Okay, “justsomeguy” got me out of the last jam. I’ve evolved my design to the next level and now my page positioning problem exists in another dimensionHere is the situation. I have a page with two iframes. Call this MainPage.html.One iframe of MainPage.html is populated by an html page with an activity diagram; call that page Diagram.html.The other iframe of MainPage.html is populated by an html page with a process document; call that page Process.html.In Diagram.html, the graphic box for step 4.1 is mapped (hotspotted) to the 4.1 heading in Process.html with the following code: <area shape="rect" coords="40,106,186,136" href="../../references/”Process.htm#_Toc177957071" target="process_iframe" alt="4.1" onclick="setTimeout('window.scrollTo(0,0);',10)" /> Note that the code includes the instruction for the window to scroll to the top after the click action is complete. The problem: When I run MainPage.html, the link from the 4.1 diagram box (in one iframe) to the 4.1 process heading (in the other iframe) does work, but the window that contains MainPage.html does not scroll to the top. I think this is because the window.scrollTo instruction is in the code for Diagram.html . . . Is there anything I can add to the code in Diagram.html – or a way to rewrite the code – that will cause the window containing MainPage.html to scroll to the top onclick? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 16, 2009 Share Posted June 16, 2009 You can refer to the parent window object using widow.parent, so this should work:setTimeout('window.parent.scrollTo(0,0);',10) Link to comment Share on other sites More sharing options...
robertalord Posted June 16, 2009 Author Share Posted June 16, 2009 Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.