Forum Moderators: open

Message Too Old, No Replies

Getting Parent frames' properties from within an iframe

         

mrwhiplash

11:37 pm on Oct 20, 2006 (gmt 0)

10+ Year Member




BASIC EXPLANATION
I have a page that loads content from a third party site The portion of the page that loads the third party code is a window within the main window. The content has links that display a rollover menu after calling an external javascript script. I use this script throughout the site. I use page properties to display the menu, i.e. document.body.scrollTop and document.body.clientHeight, etc...

THE PROBLEM.... When the script is called from the third party site window/frame within the main window, it's using the child (content) frame/window's properties and displaying the popup menu incorrectly.

NEED TO KNOW...
To get the properties of the main window so I can display my popup menu based on them, not the child window's properties. EXTRA INFO: I'm working in an enterprise J2EE environment. We use collections of jsp's displayed in one html page.

I ALREADY TRIED THIS...
parent.document.body.scrollTop
parent.parent.document.body.scrollTop.
top.document.body.scrollTop.
window.document.body.scrollTop

daveVk

12:18 pm on Oct 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See [webmasterworld.com...] I think security will prevent you doing what you desire. Test you code with iframe sourced from same domain as main page first. Welcome to WW.