Shadowbox.jsby Michael J. I. Jackson
Question: How can I open Shadowbox from inside a Flash movie?
You can place this function in between
<head> tags in your HTML document, or include it via
<script> tags. Then, in your Flash movie you need to use
getURL to call your custom callback function, like so:
Question: How can I open Shadowbox from inside an iframe?
Luckily for us, each window (including iframe windows) contains an object called
parent that refers to the parent of that window. Thus, you can use the following code inside your iframe document to access the
Shadowbox object that resides in the parent window:
var Shadowbox = window.parent.Shadowbox; // do whatever you want with Shadowbox here
Once you have access to the
Shadowbox object, you can use it as you normally would. Just remember that since the Shadowbox object still resides in the parent window, all actions will take place in the parent window. To use Shadowbox inside an iframe, you must of course include the Shadowbox code as usual at the top of the document inside the iframe.
Note: For a good example of using Shadowbox from inside an iframe, check out the source code for the form demo.
Question: Why does the Shadowbox window open up halfway down the page in Internet Explorer?
Answer: The answer to this problem may be that you are not using a strict or transitional DOCTYPE as explained on the support page. In short, placing either of the following code snippets at the top of your HTML page should help:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">