1 (edited by djmhd 2013-07-29 16:38:17)

Topic: Question about dynamicly seting config.xml in juicebox on ajax website

Hi i have a website made in ajax

with this script

<script type="text/javascript">
    function loadjuicebox(path) {
        new juicebox({
            containerId : 'juicebox-container',
            galleryWidth: "795px",
            galleryHeight: "476px",
            backgroundColor: 'rgba(0, 0, 0, 0.0)',
            xbackgroundColor:'fff',
            configUrl: path
        });
    }
</script>

<body onload="loadjuicebox('images/1/config.xml');">

<div id="juicebox-container"></div>
<a href="#" onclick="loadjuicebox('images/2/config.xml');">link</a>
</body>

how can i do to dynamicly change the path of the juicebox

because

doens't work

can you help me please.

Re: Question about dynamicly seting config.xml in juicebox on ajax website

Your code looks OK and should work fine as long as all your paths are correct and that you load the 'juicebox.js' file in your web page (as this is not in the code that you posted).
If you continue to experience difficulties, please post back with a description of the problem (does the first gallery display OK, does the second gallery not display when you click the link, are any error messages displayed?) and the URL to your web page so that I can take a look.

Re: Question about dynamicly seting config.xml in juicebox on ajax website

the code is ok
is see the juicebox frame
but when i click on the link the juicebox is displayed with the first config.xml file and not the config.xml of the link

the page is not refreshed i have an ajax part and i'm asking if i can change de path of the config.xml file without refreshing the page

Re: Question about dynamicly seting config.xml in juicebox on ajax website

but when i click on the link the juicebox is displayed with the first config.xml file and not the config.xml of the link

I tested your code and it works fine (passing the 'images/2/config.xml' path to your loadjuicebox function) on clicking the link.
Here it is in action in a test gallery.

Make sure that your two 'config.xml' files are not identical.

Please post the URL to your web page so that I can take a look and help further.

Re: Question about dynamicly seting config.xml in juicebox on ajax website

Thank you for your help :-)
your sample helped me to resolve my problem.