Body onload works -- link doesn't.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Body onload works -- link doesn't.

Soporose
Can anyone please tell me what's wrong here.

This exact code segment below works fine on one page, where the shadowbox is called from body onload.

I copied this code segment to another page where I need to call the shadowbox when a link is clicked, thus:
[a href="../../supplements/pagename.asp" rel="shadowbox"]More information...[/a]

In the case of the second page where shadowbox is called from a link, the HTML page that is being loaded into the shadowbox occupies the entire shadowbox area, and the small HTML table that contains the message I want to display appears up in the top left-hand corner.

Here's the shadowbox code which is the same on both pages:

-------------------------------------------------------
<head>



<link rel="stylesheet" type="text/css" href="/shadowbox/shadowbox.css">
<script type="text/javascript" src="/shadowbox/shadowbox.js"></script><link rel="stylesheet" type="text/css" href="/shadowbox/shadowbox.skin2.css">
<script type="text/javascript" src="/shadowbox/shadowbox.skin2.js"></script><script type="text/javascript"> Shadowbox.init({ players: ["iframe"], handleOversize:"resize", autoDimensions: true }); </script>


<script type="text/javascript"> function open_shadowbox() { Shadowbox.open({ content: '/supplements/pagename.asp', player: "iframe", title: "Important Status Message...", height: 560, width: 600 }); }; </script>


</head>
-------------------------------------------------------

So what is the setup difference between calling the shadowbox in a body onload and with a hyperlink. when called with body onload it works fine, with the HTML message I'm displaying right in the middle of the shadowbox.

TIA
 - Soporose
Reply | Threaded
Open this post in threaded view
|

Re: Body onload works -- link doesn't.

Soporose
OK, I figured it out.

The rel= component needs to include the width and height of the content box, thus:

[a href="../../supplements/pagename.asp" rel="shadowbox;width=420;height=310"]More information...[/a]

rel="shadowbox" isn't enough, and it's not enough to declare the dimensions in the shadowbox.open function.

I can't see that this requirement is mentioned on the Usage page anywhere.