SiteGenesis Mini Images Code Example

This snippet iterates through all mini images and finds matching detail images, for example, when a customer clicks a mini image.

var p : Product;
var m = p.getImages( 'swatch' );
var d = p.getImages( 'large' );
for( var i = 0; i < m.size(); i++ )
{
   // explicit bounce checks have to be implemented in JS manually
   var swatchImage = m[i];
   var largeImage = d[i];
}

Related Links

Working with Image Variants