Ryan Dorn
Ryan Dorn

Reputation: 427

How do I keep sets of images as separate galleries with jQuery Colorbox?

I have colorbox installed on Magento to serve as image galleries for specific product lines. Now, when I view the colorbox, I see all of the images in one gallery. For instance:

Gallery 1 (10 images) on Page A Gallery 2 (10 images) on Page B

On either Page A or Page B, I see 20 images within the Colorbox Image Gallery.

How do I make Colorbox only show the 10 images that correspond on Page A?

Upvotes: 1

Views: 348

Answers (1)

Jack
Jack

Reputation: 9538

Images are grouped by either the anchor elements rel attribute, or by selecting just the elements you want grouped together and give colorbox a rel property for them. Example:

$('#pageA a.photo').colorbox({rel: 'pageA'});

Upvotes: 1

Related Questions