Thank you for the clarification.
So you want to run a custom JavaScript function when a main image is clicked...
Juicebox-Pro was not designed with this in mind but you could try the following:
(1) Set imageClickMode="OPEN_URL".
(2) Set all your linkURL entries (in the gallery's XML file) to linkURL="javascript: custom_function();" (to run a custom JavaScript function named custom_function() in the gallery's embedding page when the image is clicked).
(3) Set all your linkTarget entries (also in the gallery's XML file) to linkTarget="_self".
In order for your function to know which image has been clicked (and, therefore, how to proceed), you could either:
(1) Pass a parameter (or parameters) to the custom function, e.g.:
linkURL="javascript: custom_function('abcdef');"
linkTarget="_self"
<!--START JUICEBOX EMBED-->
<script>
function custom_function(text) {
alert(text);
}
</script>
<script src="jbcore/juicebox.js"></script>
<script>
new juicebox({
containerId: "juicebox-container",
imageClickMode: "OPEN_URL"
});
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->
... or:
(2) Use the Juicebox-Pro API (in this example, the getImageIndex() function) within the custom JavaScript function to determine which image has been clicked.
linkURL="javascript: custom_function();"
linkTarget="_self"
<!--START JUICEBOX EMBED-->
<script>
function custom_function() {
var index = jb.getImageIndex();
alert('Image #' + index + ' has been clicked.');
}
</script>
<script src="jbcore/juicebox.js"></script>
<script>
var jb = new juicebox({
containerId: "juicebox-container",
imageClickMode: "OPEN_URL"
});
</script>
<div id="juicebox-container"></div>
<!--END JUICEBOX EMBED-->
Please note that this will not work if you use a baseUrl or when the gallery has been expanded.
I hope that this points you in the right direction. (Just replace the contents of the custom JavaScript function with your own code.)