Need to get offsetLeft of an iframe or div inside another iframe

N

Nathan Carr

I'm having trouble getting the offsetLeft of an iframe that is inside
a div tag inside another iframe that is inside a frame.

I have something like this (inside main.asp)

<DIV id="divHeader" name="divHeader"
style="position:relative;left:0;top:0;width:660;height:10;z-index:1">
<IFRAME NAME="iHeader" src="header.asp" frameborder=0
marginheight=0 marginwidth=0 width=100% height=100%
scrolling=no></IFRAME>
</DIV>


inside header.asp

<DIV id="divAccounts" name="divAccounts"
style="position:relative;left:0;top:0;width:100%;height:69;z-index:1">
<iframe id="iAccounts" name="iAccounts" src="somewhere.asp"
width="100%" height="69" frameborder="0" scrolling="yes" align="top"
marginwidth=0 marginheight=0 hspace=0 vspace=0></iframe>
</div>


I'm trying to do this...
top.document.getElementById("divHeader").document.getElementById("iHeader").document.getElementByID("divAccounts").offsetLeft

or

top.document.getElementById("divHeader").document.getElementById("iHeader").document.getElementByID("iAccounts").offsetLeft

it just gives me an error.

when i do
top.document.getElementById("divHeader").document.getElementById("iHeader").name,
i can get the proper name, so that's the point where I am lost

any help would be appreciated. thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top