Dynamic SWF loading in ShadowBox

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


Launching a problem when trying to dynamically load SWF 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 pasted into my page, I run the following script:

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

Everything loads correctly except for SWF. SWF is loaded with a width and height of 300x300. I'm not sure what I'm doing wrong, but any advice would be awesome. In addition, I run init () with skipSetup.


I would also like to note that if I put HTML in the sample statically (not through an AJAX call), it will work correctly after my Shadowbox.Init () (when skipSetup is output).

So it looks like setup () is not doing what it should do. Or am I doing it wrong.

!

+3
3

ShadowBox.

0

= . :.

shadowbox[Mixed];width=600;height=200;
+1

Are you sure that the HTML that you return from your AJAX matches the code that you use when you put it statically. You may have an escape problem. I would use the Firebug NET panel and check this out first.

0
source

Source: https://habr.com/ru/post/1713653/


All Articles