Miva Merchant Development by Scot's Scripts

IMAGEMACHINE: Add classes to image machine images

Miva Knowledge Base
IMAGEMACHINE: Add classes to image machine images

WARNING:

This information is offered "AS IS" for internal reference only. Use at your own risk.
Does AI actually understand your Miva Merchant store? Our smart JSON-LD schema generator makes sure it does. Contact us to get started. (more info)

IMAGEMACHINE: Add classes to image machine images

Scot Ranney • December 19, 2023


THIS CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED;
THE AUTHOR DISCLAIMS ALL LIABILITY FOR ANY DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR STORE DISRUPTIONS ARISING FROM ITS USE.


<script>
ImageMachine.prototype.ImageMachine_Generate_Thumbnail = function( thumbnail_image, main_image, closeup_image, type_code )
{
	var thumbnail, span, img;
	thumbnail	= document.createElement( 'li' );
	thumbnail.className = "list-inline-item";
	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.className = "img-thumbnail";
		thumbnail.appendChild( img );
	}
	return thumbnail;
}
</script>

https://www.scotsscripts.com/mvblog/imagemachine-add-classes-to-image-machine-images.html

mvkb_imagemachine