Lotus // Lazy Load thumbnails (slick slider)
<mvt:assign name="l.settings:clean:product:name" value="glosub(l.settings:product:name, asciichar(39), ''')" />
<script>
var gallery = [],
thumbnailIndex = 0;
ImageMachine.prototype.ImageMachine_Generate_Thumbnail = function (thumbnail_image, main_image, closeup_image, type_code) {
var thumbnail,
img;
thumbnail = document.createElement('div');
thumbnail.className = 'thumbnail';
thumbnail.setAttribute('data-index', thumbnailIndex++);
thumbnail.setAttribute('data-large', closeup_image);
if (typeof(thumbnail_image) == 'string' && thumbnail_image.length > 0) {
img = document.createElement('img');
// Lazy Loading
img.setAttribute('data-lazy', thumbnail_image);
thumbnail.appendChild(img);
gallery.push({
src: closeup_image,
title: '&mvt:clean:product:name;'
});
};
return thumbnail;
};
</script>