Q:

jQuery Fancybox - Multiple Galleries - Multiple Open buttons

Ok here we go...
What i'm trying to achieve is to have multiple galleries on a page, but instead of clicking on the thumbnail to open them, I want to have a custom open button.
<a href="#" class="gallerya">Open Gallery 1</a>
<a href="#" class="galleryb">Open Gallery 2</a>
<a href="#" class="galleryc">Open Gallery 3</a>

There should be multiple images within each gallery. Is this possible? If so, how?

A:

You haven't specified which version of Fancybox you're using. Assuming it's version 2, here's what you're looking for: FIDDLE.
Basically, you keep all gallery images in a Javascript array. Like so:
var images = {
    'gallerya': [
        {
            href : 'http://fancyapps.com/fancybox/demo/1_b.jpg',                
            title : 'Gallery 1 - 1'
        },
        {
            href : 'http://fancyapps.com/fancybox/demo/2_b.jpg',                
            title : 'Gallery 1 - 2'
        },
        {
            href : 'http://fancyapps.com/fancybox/demo/3_b.jpg',                
            title : 'Gallery 1 - 3'
        }
    ],
    'galleryb': [
        {
            href : 'http://fancyapps.com/fancybox/demo/4_b.jpg',                
            title : 'Gallery 2 - 1'
        },
        {
            href : 'http://fancyapps.com/fancybox/demo/5_b.jpg',                
            title : 'Gallery 2 - 2'
        }
    ],
    ...
};

Then you create a custom click handler for your gallery openers and call the $.fancybox.open method with the gallery you want. Check the fiddle to see the details.
$(".gallery-opener").click(function() {
    $.fancybox.open(images[$(this).data('gallery-id')], {
        padding : 0
    });

    return false;
});

