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

"Design is not just what it looks like and feels like. Design is how it works."

Steve Jobs


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