Topic: Two simpleviewer gallery on one page

I do have two simpleviewer gallery on several website pages. I am using:
<script type="text/javascript">
var flashvars = {};
flashvars.galleryURL = "design3/header/header_www.xml";
var params = {};
params.wmode = "transparent";
simpleviewer.ready(function(){simpleviewer.load("box_slideshow","100%", "100%", "555555", true, flashvars, params);});
</script>

This is working fine for flash but give problems with the non-flash galleries. I have noticed that the variable flashvars is global for the page in the non-flash version but local in the flash galleries. This is annoying.
I have to use the next to get it working in the non-flash galleries:
<script type="text/javascript">
var flashvars1 = {};
flashvars1.galleryURL = "picturegallery/portugal/madeira_1.xml";
var params = {};
params.wmode = "transparent";
simpleviewer.ready(function(){simpleviewer.load("flashcontent","100%", "100%", "transparent", true, flashvars1, params);});
</script>
<script type="text/javascript">
var flashvars2 = {};
flashvars2.galleryURL = "design3/header/header_www.xml";
var params = {};
params.wmode = "transparent";
simpleviewer.ready(function(){simpleviewer.load("box_slideshow","100%", "100%", "555555", true, flashvars2, params);});
</script>
without the different flashvars variable the header_www.xml is used for both galleries in the non-flash ones.
This is not a nice solution and I think it will need a change in simpleviewer.js

Re: Two simpleviewer gallery on one page

In my tests, using the same variable name for both galleries will use the last value given to the variable (as you have discovered).
However, unlike your own tests, my tests show that this is consistent across both the Flash Player and the Mobile Player.
Make sure you are using the latest version of SimpleViewer-Pro (v2.2.0).
Please see the Upgrading SimpleViewer-Pro page if required.
As you have discovered, using unique variable names is a workable solution.
Otherwise, you could include the galleryURL in the 'simpleviewer.load' line as follows:

simpleviewer.load("sv-container", "100%", "100%", "222222", true, { galleryURL: "gallery.xml" });

Also, you can give a gallery a transparent background by setting the backgroundColor Embed Code Parameter to 'transparent' as follows (rather than by setting the Flash Param 'wmode' to transparent which is what SimpleViewer does behind the scenes when setting backgroundColor to 'transparent'):

simpleviewer.load("sv-container", "100%", "100%", "transparent", true, { galleryURL: "gallery.xml" });
Steven Speirs
SimpleViewer Support Team.

Re: Two simpleviewer gallery on one page

Hi Steven,

Thanks for your reply, your solution with galleryURL is a better one. Yes I am using v2.2.0 and it solved me many problems with the non-flash gallery.

regards
Hans