File "product-cls.js"

Full Path: /home/romayxjt/public_html/wp-content/themes/kadence/assets/js/src/product-cls.js
File size: 526 bytes
MIME-type: text/plain
Charset: utf-8

/**
 * File product-cls.js.
 * Sets a fixed height while loading the product image slider to fix an issue with CLS. This should ultimately be fixed by wooocommerce/flexslider
 */

 jQuery( function( $ ) {
	$( '.woocommerce-product-gallery.gallery-has-thumbnails' ).each( function() {
		var gallery_wrap = $( this );
		gallery_wrap.height( gallery_wrap.height() );
		gallery_wrap.on( 'wc-product-gallery-after-init', function (event) {
			setTimeout( function() {
				gallery_wrap.height( '' );
			}, 500 );
		} );
	} );
} );