By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,607 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,607 IT Pros & Developers. It's quick & easy.

One popup div, multiple documents

P: n/a
I'm having a problem trying to use a single DIV object for a popup menu
when I'm using embedded IFrames. All the IFrames have the same parent
document but I can't make the popup appear inside of each IFrame unless
I appendChild the popup DIV to each individual IFrame document body.
Should I be able to show the popup without having to reparent the popup
object? Are there any tricks to be aware of?

Cliff

Dec 4 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
VK

de*******@gmail.com wrote:
I'm having a problem trying to use a single DIV object for a popup menu
when I'm using embedded IFrames. All the IFrames have the same parent
document but I can't make the popup appear inside of each IFrame unless
I appendChild the popup DIV to each individual IFrame document body.
Should I be able to show the popup without having to reparent the popup
object? Are there any tricks to be aware of?


IFRAME is a separate window-type object with its own document in it. So
any alement (like DIV) can be inside of IFRAME in only one way: *by
being inside* - means being a part of IFRAME document DOM structure.

If by "inside" you mean "atop of a particular iframe" then you can
achieve it by setting myDIV.style.zIndex higher than IFRAME and
locating your DIV atom of the IFRAME.

Dec 4 '05 #2

P: n/a
Here's the function I'm using to try and get the vertical y position of
an anchor element within an IFrame, that is within my document:

MyUtils.findPosY=function(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}

I'm calling the function with the Anchor Element and no matter what
I've tried I always get a Y position of 1, not the actual position
within the browser window. Any further ideas?

Cliff.

Dec 11 '05 #3

P: n/a
de*******@gmail.com wrote:
MyUtils.findPosY=function(obj)
{
var curtop = 0;
if (obj.offsetParent)
{
while (obj.offsetParent)
Instead:

while (obj)
{
curtop += obj.offsetTop
obj = obj.offsetParent;
}
}
else if (obj.y)
curtop += obj.y;
return curtop;
}

I'm calling the function with the Anchor Element and no matter what
I've tried I always get a Y position of 1, not the actual position
within the browser window. Any further ideas?


You need to test `obj', because you assign `obj.offsetParent' at the
end of each loop.
PointedEars
Dec 11 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.