Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Same level offset frames
Message
De
02/02/2012 19:16:07
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
02/02/2012 15:13:36
Information générale
Forum:
Javascript
Catégorie:
IFrame
Divers
Thread ID:
01534344
Message ID:
01534367
Vues:
28
>Lets assume the fact that I have a main container with several IFrames at the same level. Thus, I could have one IFrame on the left and next to it, another IFrame with about the same height.
>
>When I do a specific operation, I need to obtain the exact pixel in width from the browser itself. I can determine the width offset of a specific Div on that page. But, in order to position something exactly where I want, I need to also obtain the width of the IFrame sitting on the left.
>
>So, basically, the IFrame on the right knows about its parent. In this case, it is the main container. But, it doesn't know anything about the IFrame on the left. It could, but I would have to hardcode it such as window.parent.TheFrameOnTheLeft.scrollWidth. But, I need a generic way of knowing it. Is there somekind of formula I could use to obtain all the frame sitting on the left side of the frame I am working with, no matter how much frames there would be?
Why not give them specific IDs? Then get one by one by Id (getElementById, or $("#id") in jQuery), and you got your object reference to each.

If you don't know in advance how many of them you may have, then it's a bit tougher. I'd go for all iFrames (get...ByTag), then comb the collection for the ones that share the level (i.e. same parent) as your iFrame.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform