If you are looking for a solution to switch galleries via links on a single page, loading the selected galleries into a specified container, then you might like to try the following which loads a gallery on demand by running a JavaScript function when a link is clicked, passing the baseURL (gallery folder path) as a parameter.
More information about the baseURL method of embedding can be found here.
As an example, create a couple of different galleries with svBuilder, name the gallery folders 'gallery1' and 'gallery2'.
Now put the code below in an HTML file of its own, place it in the same directory as the gallery folders and open it in a browser.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="gallery1/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
function loadGallery(base) {
var flashvars = {};
flashvars.baseURL = base;
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "800", "600", "222222", true, flashvars);
});
$('.gallery').css('text-decoration', 'none');
$('#' + base).css('text-decoration', 'underline');
}
$(document).ready(function() {
$('.gallery').click(function() {
var base = $(this).attr('id');
loadGallery(base);
});
loadGallery('gallery1');
});
</script>
<title>Test</title>
</head>
<body>
<div id="links">
<input id="gallery1" class="gallery" type="button" value="Gallery 1" />
<span> </span>
<input id="gallery2" class="gallery" type="button" value="Gallery 2" />
</div>
<div id="sv-container"></div>
</body>
</html>
You can have as many galleries as you like and the links can be anything you like (text, images, buttons).
Just give each of your gallery links a 'class' attribute of "gallery" and an 'id' attribute of the name of the gallery folder.
The gallery folders should all be in the same directory as the HTML file.
Hopefully you will be able to modify the code to suit your own needs. If you get stuck, just give me a shout.
Please note that my suggestion above uses jQuery. SimpleViewer comes with its own bundled version of jQuery (within the 'simpleviewer.js' file) so basic jQuery functionality is available as soon as the 'simpleviewer.js' file is loaded in the page (and without the need to explicitly include a separate jQuery JavaScript file).
However, if your web page uses any jQuery code at all, I would recommend including a separate jQuery JavaScript file (just in case we remove any jQuery functionality from the 'simpleviewer.js' file in the future).
Steven Speirs
SimpleViewer Support Team