... but won't making a gallery addition like this createa new jbcore folder?
Yes, but if you change the path to the 'juicebox.js' file to point towards the shared 'jbcore' folder, then you can just delete (or ignore) the 'jbcore' folder in the new gallery.
It sounds like you want to have a link within your gallery to replace the gallery itself with a different one in the same container (your text widget) on your WordPress page. This would not be easy to do at all. It would require a lot of custom coding and knowledge of HTML and JavaScript would be required.
If you were willing to include the links to the different galleries in the text widget alongside the galleries (rather than within the galleries), then you could use code such as the following in your text widget.
In this example, you would upload two complete gallery folders named 'winter' and 'summer' to your root directory.
You would also upload a single 'jbcore' folder to your root directory and you could then delete the 'jbcore' folders in each gallery if you like (as they would not be used).
<script type="text/javascript" src="/jbcore/juicebox.js"></script>
<script type="text/javascript">
function loadGallery(base) {
new juicebox({
baseUrl: base,
containerId: "juicebox-container",
galleryHeight: "250",
galleryWidth: "100%"
});
}
$(document).ready(function() {
$('.gallery').click(function() {
var base = '/' + $(this).attr('id') + '/';
loadGallery(base);
});
loadGallery('/winter/');
});
</script>
<div id="links">
<input id="winter" class="gallery" type="button" value="Winter" />
<span> </span>
<input id="summer" class="gallery" type="button" value="Summer" />
</div>
<div id="juicebox-container"></div>
If you want to add any more galleries, then the 'id' of the new link should be the name of the gallery folder (uploaded to your root directory).
Incidentally, the <input> tags above could be replaced with <span> tags (for a text link instead of a button) if you like, e.g.:
<span id="winter" class="gallery">Winter</span>
<span> </span>
<span id="summer" class="gallery">Summer</span>