Ashley Cameron Design

Ashley Cameron Design

Shop the Creative Design Market

Goodnight

Give unique rel tags to multiple galleries of images on the same page – fancybox

jQuerySnippets

About a 1 minute read

"It’s not what you look at that matters, it’s what you see."

Henry David Thoreau


1
2
3
4
5
6
//give unique gallery # to groups of images for fancybox
jQuery('.gallery').each(function (g) {
    $('a', this).attr('rel', function (i, attr) {
        return attr + ' gallery-' + g;
    });
});