views:

819

answers:

2

FYI, ShadowBox is a javscript media viewer/lightbox. http://www.shadowbox-js.com/


Running into an issue when trying to dynamically load SWFs into my ShadowBox.

My script outputs the following HTML:

<div id="LightBoxItemList">
<a href="Images/large01.jpg" rel="shadowbox[Mixed];" class="First" />
<a href="Images/Hydro_Sample.swf" rel="shadowbox[Mixed];width: 800;height: 600;" />
<a href="Images/large01.jpg" rel="shadowbox[Mixed];" />
</div>

After this HTML is created and inserted into my page, I run the following script:

Shadowbox.clearCache();
Shadowbox.setup("#LightBoxItemList a");

Everything loads correct except the SWF. The SWF loads with a width and height of 300x300. I'm not sure what I'm doing wrong, but any advice would be awesome. Also, I'm running init() with skipSetup.


I would also note that if I put in the HTML into the sample statically (not through an AJAX call), it works correctly after my Shadowbox.Init() (with skipSetup taken out).

So it looks like setup() isn't doing what it should be doing. Or I'm doing it wrong.

Any suggestions would be greatly appreciated!

A: 

Are you sure the HTML you get back from your AJAX is the same as the code that you are using when you put it in statically. You may be having some escaping issues. I'd use Firebug's NET panel and check that out first.

easement
Yup. Copy and pasted the above code returned from the AJAX call as static to test. Works as static text after init(), but not as dynamic after setup().
1kevgriff
A: 

It is a quirk in ShadowBox.

1kevgriff