If you're willing to use some javascript and constrain yourself within certain limitations, you could make a helper function that can speed up the process for you.
Fancybox API allows you to call a function to generate a new gallery on the fly:
$.fancybox( [A], {B});
Where [A] is an array of objects, each one specifying a content object (and the order in wich they appear in the fancybox presentation will correspond with their index in the array); and {B} is an options object containing the customisations you want for this instance of fancybox.
The content objects can have multiple optional properties that fancybox uses to enrich the presentation, such as a title for the image, but in this case we only need the address path, leaving you with e.g:
var content = {
href: "path/to/image.jpg"
};
If you have your images in a known location and named in secuential numeric order, you can make a function that fills an array with all the individual locations of this images to pass to the $.fancybox( [A], {B})
function:
//remember that your first image must have "0" as number!!
function createPaths(prefix, amount, sufix) {
var addresses = [];
for(var i = 0; i < amount; i++) {
var thisAddress = prefix + i + sufix;
addresses[i] = { href: thisAddress };
}
return addresses;
}
Then you call this function for each whole presentation, eg:
//This variable will store 124 objects with
// the images' paths (path/to/0.jpg, path/to/1.jpg ... path/to/123.jpg)
var allImages_gallery_1 = createPaths("path/to/" , 124, ".jpg");
And finally, pass this array to $.fancybox();
, but put it inside another function, like this:
function open_gallery_1() {
$.fancybox( allImages_gallery_1, optionsObject );
}
Then, in your HTML you can make anything call this function with the onclick="" attribute, eg:
<img src="image.jpg" onclick="open_gallery_1();">