Last active
August 29, 2015 14:07
-
-
Save tessguefen/40ae4b20dd292d1542ca to your computer and use it in GitHub Desktop.
External Zoom Image Machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== 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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment