Ashley Cameron Design

Ashley Cameron Design

Shop the Creative Design Market

Good morning

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

jQuerySnippets

About a 1 minute read

"The art of living… is neither careless drifting on the one hand nor fearful clinging to the past on the other. It consists in being sensitive to each moment, in regarding it as utterly new and unique, in having the mind open and wholly receptive."

Alan Watts


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;
    });
});