function(trigger,action,config){var $target = jQuery( this ), offset = $target.offset(), target_w = $target.outerWidth(), target_h = $target.outerHeight(), $element = $target; /* If it is the same img but set from Anim&Action work like Open full size image on click*/ if ( config.id && ( config.url && $element.attr( 'src' ) !== config.url ) ) { $element = jQuery( "#tcb-image-zoom-" + config.id + " img" ) } else if ( $element.find( "img" ).length ) { $element = $element.find( "img" ) } var image_src = $element.attr( "src" ), $lightbox = jQuery( '#tve_zoom_lightbox' ), $overlay = jQuery( '#tve_zoom_overlay' ), windowWidth = window.innerWidth, windowHeight = window.innerHeight, img_size = $element.data( "tve-zoom-clone" ), resizeScale = windowWidth < 600 ? 0.8 : 0.9; if ( typeof img_size === 'undefined' ) { var $clone = $element.clone() .css( { position: "absolute", width: "", height: "", left: "-8000px", top: "-8000px" } ).removeAttr( "width height" ); $clone.appendTo( "body" ); $clone.on( 'load', function () { const height = parseFloat( $element.attr( 'height' ) ), width = parseFloat( $element.attr( 'width' ) ); img_size = { "originalWidth": width, "width": width, "originalHeight": height, "height": height }; if ( img_size.originalWidth > windowWidth * resizeScale || img_size.originalHeight > windowHeight * resizeScale ) { var widthPercent = img_size.originalWidth / windowWidth, heightPercent = img_size.originalHeight / windowHeight; img_size.width = ( ( widthPercent > heightPercent ) ? ( windowWidth * resizeScale ) : ( windowHeight * resizeScale * ( img_size.originalWidth / img_size.originalHeight ) ) ); img_size.height = ( ( widthPercent > heightPercent ) ? ( windowWidth * resizeScale * ( img_size.originalHeight / img_size.originalWidth ) ) : ( windowHeight * resizeScale ) ); } img_size.width += 30; img_size.height += 30; $element.data( "tve-zoom-clone", img_size ); show_lightbox(); } ); } else { show_lightbox(); } function show_lightbox() { if ( $lightbox.length ) { $lightbox.show(); } else { $lightbox = jQuery( "