tessguefen
10/20/2014 - 4:13 PM

Colorbox pop up, with titles and additional images -- Example

Colorbox pop up, with titles and additional images -- Example

<mvt:item name="customfields" param="Read_Product_Code( l.settings:product:code, 'main_img_title, add_title1, add_title2, add_title3, add_title4, add_title5', l.settings:customfields )" />

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
        atag        = document.createElement( 'a' );

        thumbnail.appendChild( span );

        if ( typeof( thumbnail_image ) == 'string' && thumbnail_image.length > 0 )
        {
            img		= document.createElement( 'img' );
            img.src	= thumbnail_image;
            atag.href = closeup_image;
            atag.className = 'vlightbox1';
            
            if (type_code == 'main') {
                atag.title = '&mvt:product:customfield_values:customfields:main_img_title;';
            } else if (type_code == 'add_1') {
                atag.title = '&mvt:product:customfield_values:customfields:add_title1;';
            } else if (type_code == 'add_2') {
                 atag.title = '&mvt:product:customfield_values:customfields:add_title2;';
            } else if (type_code == 'add_3') {
                 atag.title = '&mvt:product:customfield_values:customfields:add_title3;';
            } else if (type_code == 'add_4') {
                 atag.title = '&mvt:product:customfield_values:customfields:add_title4;';
            } else if (type_code == 'add_5') {
                 atag.title = '&mvt:product:customfield_values:customfields:add_title5;';
            }
            atag.appendChild( img );
            thumbnail.appendChild( atag );
        }

        return thumbnail;
}