2

I've got a javascript include that's declared in the head of the frameset of a site, this js file has a number of methods in it. I need to call the method from one of the framesets child frames but can't quite figure it out, could someone help me out? Here's my call that's not working:

<a href="javascript:window.parent.launchLightbox('start');">launch lightbox</a>

Unfortunately the js needs to be added to the frameset as the lightbox needs to fill the whole screen and not just in the dimensions of the child frame where the above code sits.

Thanks, Colin.

1
  • Of course, if someone could suggest a way to launch a lightbox over all frames then that is a valid answer, the above is me trying to work around this issue. Commented Jun 23, 2011 at 12:22

1 Answer 1

1

I think you can access it with window.top (coming from my memory though)

Sign up to request clarification or add additional context in comments.

6 Comments

Interesting, the above works but no lightbox is shown... could this be because the frameset isn't visible or something?
It depends on the structure of your frameset also. In a simple frame tree with a frameset and for example two frames, top and parent return the same thing from one of the frames. Have you looked into the execution with firebug ?
Oh dear, just investigated a bit further and the site is using a frameset within a frameset! Horrible. THe structure is as follows: First frameset: top and body below. body frame contains a frameset with left and right. doing window.top works when it's in the top level frame but not in the 2nd (left and right) frameset. Ideally I want the lightbox to appear above all these frames but I'm not sure that's possible?
Made a modification so the js fires: window.top.frames[1]. was what I needed. @Jad I'm not sure I understand what I should be looking for in Firebug?
You could use it to trace what the launchLightbox function 'sees' where it is called, for example when it checks the dimensions of the window. "top" returns the highest window possible so indeed the top frameset. I think when you did window.parent from the bottom frames you were getting the intermediate level frameset.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.