SEPARATE JACK MOORE ZOOM FILE IN SHOPIFY DEBUT THEME 2️⃣

 

/*!
Zoom 1.7.21
license: MIT
CODE GOT FROM REAL SHOPIFY DEBUT THEME
REMOVE COMMA , AT END YOUR CODE 
PASTE YOUR ZOOM CODE AFTER EXCLAMATION MARK AND BEFORE Semicolon
!
YOUR ZoomCode
;
http://www.jacklmoore.com/zoom
*/

!
function(e){var t={url:!1,callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,onZoomIn:!1,onZoomOut:!1,magnify:1};e.zoom=function(t,n,i,o){var r,s,a,l,u,c,d,p=e(t),f=p.css("position"),h=e(n);return t.style.position=/(absolute|fixed)/.test(f)?f:"relative",t.style.overflow="hidden",i.style.width=i.style.height="",e(i).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:i.width*o,height:i.height*o,border:"none",maxWidth:"none",maxHeight:"none"}).appendTo(t),{init:function(){s=p.outerWidth(),r=p.outerHeight(),n===t?(l=s,a=r):(l=h.outerWidth(),a=h.outerHeight()),u=(i.width-s)/l,c=(i.height-r)/a,d=h.offset()},move:function(e){var t=e.pageX-d.left,n=e.pageY-d.top;n=Math.max(Math.min(n,a),0),t=Math.max(Math.min(t,l),0),i.style.left=t*-u+"px",i.style.top=n*-c+"px"}}},e.fn.zoom=function(n){return this.each(function(){var i=e.extend({},t,n||{}),o=i.target&&e(i.target)[0]||this,r=this,s=e(r),a=document.createElement("img"),l=e(a),u="mousemove.zoom",c=!1,d=!1;if(!i.url){var p=r.querySelector("img");if(p&&(i.url=p.getAttribute("data-src")||p.currentSrc||p.src),!i.url)return}s.one("zoom.destroy",function(e,t){s.off(".zoom"),o.style.position=e,o.style.overflow=t,a.onload=null,l.remove()}.bind(this,o.style.position,o.style.overflow)),a.onload=function(){function t(t){p.init(),p.move(t),l.stop().fadeTo(e.support.opacity?i.duration:0,1,!!e.isFunction(i.onZoomIn)&&i.onZoomIn.call(a))}function n(){l.stop().fadeTo(i.duration,0,!!e.isFunction(i.onZoomOut)&&i.onZoomOut.call(a))}var p=e.zoom(o,r,a,i.magnify);"grab"===i.on?s.on("mousedown.zoom",function(i){1===i.which&&(e(document).one("mouseup.zoom",function(){n(),e(document).off(u,p.move)}),t(i),e(document).on(u,p.move),i.preventDefault())}):"click"===i.on?s.on("click.zoom",function(i){return c?void 0:(c=!0,t(i),e(document).on(u,p.move),e(document).one("click.zoom",function(){n(),c=!1,e(document).off(u,p.move)}),!1)}):"toggle"===i.on?s.on("click.zoom",function(e){c?n():t(e),c=!c}):"mouseover"===i.on&&(p.init(),s.on("mouseenter.zoom",t).on("mouseleave.zoom",n).on(u,p.move)),i.touch&&s.on("touchstart.zoom",function(e){e.preventDefault(),d?(d=!1,n()):(d=!0,t(e.originalEvent.touches[0]||e.originalEvent.changedTouches[0]))}).on("touchmove.zoom",function(e){e.preventDefault(),p.move(e.originalEvent.touches[0]||e.originalEvent.changedTouches[0])}).on("touchend.zoom",function(e){e.preventDefault(),d&&(d=!1,n())}),e.isFunction(i.callback)&&i.callback.call(a)},a.setAttribute("role","presentation"),a.alt="",a.src=i.url})},e.fn.zoom.defaults=t}(window.jQuery)
;

Comments

Popular posts from this blog

ADD AUTOCOMPLETE SEARCH BOX IN SHOPIFY DEBUT THEME 5️⃣