External Zoom Image Machine
== Custom.js ==
$('#thumbnails img').on('click', function() {
$('a.zoom').attr('href', $(this).attr('data-large'));
$('a.zoom').easyZoom({
preload: '<p class="preloader">Loading the image</p>',
parent: '.product-main'
});;
});
$('a.zoom').easyZoom({
preload: '<p class="preloader">Loading the image</p>',
parent: '.product-main'
});
== Image Machine ==
ImageMachine.prototype.ImageMachine_Generate_Thumbnail = function( thumbnail_image, main_image, closeup_image, type_code )
{
var thumbnail, span, img, atag;
thumbnail = document.createElement( 'li' );
span = document.createElement( 'span' ); // to vertically center the thumbnail images
thumbnail.appendChild( span );
if ( typeof( thumbnail_image ) == 'string' && thumbnail_image.length > 0 )
{
img = document.createElement( 'img' );
img.src = thumbnail_image;
img.setAttribute('data-large', closeup_image);
thumbnail.appendChild( img );
}
return thumbnail;
}