HOW CAN I ADD DEBUT THEME VERSION 12.2.1 ZOOM FUNCTION 1.7.21 IN DIFFERENT JAVA SCRIPT FILE

Highlighted
New Member
1 0 0

DEAR SIR/MADAM, I USED BELOW CODE AND SAVE A FILE jquery.zoom.min.js AND ADD LINK

<script src="{{'jquery.zoom.min.js' | asset_url }}" defer="defer"></script> 

IN  theme.liquid BUT CODE BELOW DOES NOT WORK 

product-template.liquid.png

2.png

 

* jquery.zoom.min.js
*/
/*!
Zoom 1.7.21
license: MIT
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),function(){function e(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e}function t(e,t,n){for(var i=-1,o=e.length;++i<o;){var r=e[i],s=t(r);if(null!=s&&(a===le?s===s:n(s,a)))var a=s,l=r}return l}function n(e,t,n){var i;return n(e,function(e,n,o){return t(e,n,o)?(i=e,!1):void 0}),i}function i(e,t,n,i,o){return o(e,function(e,o,r){n=i?(i=!1,e):t(n,e,o,r)}),n}function o(e,t){return T(t,function(t){return e[t]})}function r(e){return e&&e.Object===Object?e:null}function s(e){return fe[e]}function a(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function l(e,t){return e="number"==typeof e||pe.test(e)?+e:-1,e>-1&&0==e%1&&(null==t?9007199254740991:t)>e}function u(e){if(Z(e)&&!Re(e)){if(e instanceof c)return e;if(Se.call(e,"__wrapped__")){var t=new c(e.__wrapped__,e.__chain__);return t.__actions__=A(e.__actions__),t}}return new c(e)}function c(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t}function d(e,t,n,i){var o;return(o=e===le)||(o=Te[n],o=(e===o||e!==e&&o!==o)&&!Se.call(i,n)),o?t:e}function p(e){return J(e)?Ne(e):{}}function f(e,t,n){if("function"!=typeof e)throw new TypeError("Expected a function");return setTimeout(function(){e.apply(le,n)},t)}function h(e,t){var n=!0;return Pe(e,function(e,i,o){return n=!!t(e,i,o)}),n}function v(e,t){var n=[];return Pe(e,function(e,i,o){t(e,i,o)&&n.push(e)}),n}function g(t,n,i,o){o||(o=[]);for(var r=-1,s=t.length;++r<s;){var a=t[r];n>0&&Z(a)&&V(a)&&(i||Re(a)||Y(a))?n>1?g(a,n-1,i,o):e(o,a):i||(o[o.length]=a)}return o}function m(e,t){return e&&Le(e,t,ie)}function y(e,t){return v(t,function(t){return G(e[t])})}function b(e,t,n,i,o){return e===t||(null==e||null==t||!J(e)&&!Z(t)?e!==e&&t!==t:w(e,t,b,n,i,o))}function w(e,t,n,i,o,r){var s=Re(e),l=Re(t),u="[object Array]",c="[object Array]";s||(u=$e.call(e),"[object Arguments]"==u&&(u="[object Object]")),l||(c=$e.call(t),"[object Arguments]"==c&&(c="[object Object]"));var d="[object Object]"==u&&!a(e),l="[object Object]"==c&&!a(t);return!(c=u==c)||s||d?2&o||(u=d&&Se.call(e,"__wrapped__"),l=l&&Se.call(t,"__wrapped__"),!u&&!l)?!!c&&(r||(r=[]),(u=M(r,function(t){return t[0]===e}))&&u[1]?u[1]==t:(r.push([e,t]),t=(s?P:_)(e,t,n,i,o,r),r.pop(),t)):n(u?e.value():e,l?t.value():t,i,o,r):L(e,t,u)}function x(e){var t=typeof e;return"function"==t?e:null==e?se:("object"==t?S:$)(e)}function k(e){e=null==e?e:Object(e);var t,n=[];for(t in e)n.push(t);return n}function T(e,t){var n=-1,i=V(e)?Array(e.length):[];return Pe(e,function(e,o,r){i[++n]=t(e,o,r)}),i}function S(e){var t=ie(e);return function(n){var i=t.length;if(null==n)return!i;for(n=Object(n);i--;){var o=t[i];if(!(o in n&&b(e[o],n[o],le,3)))return!1}return!0}}function C(e,t){return e=Object(e),W(t,function(t,n){return n in e&&(t[n]=e[n]),t},{})}function $(e){return function(t){return null==t?le:t[e]}}function E(e,t,n){var i=-1,o=e.length;for(0>t&&(t=-t>o?0:o+t),n=n>o?o:n,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0,n=Array(o);++i<o;)n[i]=e[i+t];return n}function A(e){return E(e,0,e.length)}function j(e,t){var n;return Pe(e,function(e,i,o){return n=t(e,i,o),!n}),!!n}function N(t,n){return W(n,function(t,n){return n.func.apply(n.thisArg,e([t],n.args))},t)}function D(e,t,n,i){n||(n={});for(var o=-1,r=t.length;++o<r;){var s=t[o],a=i?i(n[s],e[s],s,n,e):e[s],l=n,u=l[s];Se.call(l,s)&&(u===a||u!==u&&a!==a)&&(a!==le||s in l)||(l[s]=a)}return n}function O(e){return U(function(t,n){var i=-1,o=n.length,r=o>1?n[o-1]:le,r="function"==typeof r?(o--,r):le;for(t=Object(t);++i<o;){var s=n[i];s&&e(t,s,i,r)}return t})}function H(e){return function(){var t=arguments,n=p(e.prototype),t=e.apply(n,t);return J(t)?t:n}}function q(e,t,n){function i(){for(var r=-1,s=arguments.length,a=-1,l=n.length,u=Array(l+s),c=this&&this!==xe&&this instanceof i?o:e;++a<l;)u[a]=n[a];for(;s--;)u[a++]=arguments[++r];return c.apply(t,u)}if("function"!=typeof e)throw new TypeError("Expected a function");var o=H(e);return i}function P(e,t,n,i,o,r){var s=-1,a=1&o,l=e.length,u=t.length;if(l!=u&&!(2&o&&u>l))return!1;for(u=!0;++s<l;){var c=e[s],d=t[s];if(void 0!==le){u=!1;break}if(a){if(!j(t,function(e){return c===e||n(c,e,i,o,r)})){u=!1;break}}else if(c!==d&&!n(c,d,i,o,r)){u=!1;break}}return u}function L(e,t,n){switch(n){case"[object Boolean]":case"[object Date]":return+e==+t;case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object Number]":return e!=+e?t!=+t:e==+t;case"[object RegExp]":case"[object String]":return e==t+""}return!1}function _(e,t,n,i,o,r){var s=2&o,a=ie(e),l=a.length,u=ie(t).length;if(l!=u&&!s)return!1;for(var c=l;c--;){var d=a[c];if(!(s?d in t:Se.call(t,d)))return!1}for(u=!0;++c<l;){var d=a[c],p=e[d],f=t[d];if(void 0!==le||p!==f&&!n(p,f,i,o,r)){u=!1;break}s||(s="constructor"==d)}return u&&!s&&(n=e.constructor,i=t.constructor,n!=i&&"constructor"in e&&"constructor"in t&&!("function"==typeof n&&n instanceof n&&"function"==typeof i&&i instanceof i)&&(u=!1)),u}function z(e){var t=e?e.length:le;if(Q(t)&&(Re(e)||ee(e)||Y(e))){e=String;for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);t=i}else t=null;return t}function I(e){var t=e&&e.constructor,t=G(t)&&t.prototype||Te;return e===t}function F(e){return e?e[0]:le}function M(e,t){return n(e,x(t),Pe)}function R(e,t){return Pe(e,"function"==typeof t?t:se)}function W(e,t,n){return i(e,x(t),n,3>arguments.length,Pe)}function B(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=We(e),function(){return 0<--e&&(n=t.apply(this,arguments)),1>=e&&(t=le),n}}function U(e){var t;if("function"!=typeof e)throw new TypeError("Expected a function");return t=qe(t===le?e.length-1:We(t),0),function(){for(var n=arguments,i=-1,o=qe(n.length-t,0),r=Array(o);++i<o;)r[i]=n[t+i];for(o=Array(t+1),i=-1;++i<t;)o[i]=n[i];return o[t]=r,e.apply(this,o)}}function X(e,t){return e>t}function Y(e){return Z(e)&&V(e)&&Se.call(e,"callee")&&(!De.call(e,"callee")||"[object Arguments]"==$e.call(e))}function V(e){return null!=e&&!("function"==typeof e&&G(e))&&Q(_e(e))}function G(e){return e=J(e)?$e.call(e):"","[object Function]"==e||"[object GeneratorFunction]"==e}function Q(e){return"number"==typeof e&&e>-1&&0==e%1&&9007199254740991>=e}function J(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Z(e){return!!e&&"object"==typeof e}function K(e){return"number"==typeof e||Z(e)&&"[object Number]"==$e.call(e)}function ee(e){return"string"==typeof e||!Re(e)&&Z(e)&&"[object String]"==$e.call(e)}function te(e,t){return t>e}function ne(e){return"string"==typeof e?e:null==e?"":e+""}function ie(e){var t=I(e);if(!t&&!V(e))return He(Object(e));var n,i=z(e),o=!!i,i=i||[],r=i.length;for(n in e)!Se.call(e,n)||o&&("length"==n||l(n,r))||t&&"constructor"==n||i.push(n);return i}function oe(e){for(var t=-1,n=I(e),i=k(e),o=i.length,r=z(e),s=!!r,r=r||[],a=r.length;++t<o;){var u=i[t];s&&("length"==u||l(u,a))||"constructor"==u&&(n||!Se.call(e,u))||r.push(u)}return r}function re(e){return e?o(e,ie(e)):[]}function se(e){return e}function ae(t,n,i){var o=ie(n),r=y(n,o);null!=i||J(n)&&(r.length||!o.length)||(i=n,n=t,t=this,r=y(n,ie(n)));var s=!(J(i)&&"chain"in i)||i.chain,a=G(t);return Pe(r,function(i){var o=n[i];t[i]=o,a&&(t.prototype[i]=function(){var n=this.__chain__;if(s||n){var i=t(this.__wrapped__);return(i.__actions__=A(this.__actions__)).push({func:o,args:arguments,thisArg:t}),i.__chain__=n,i}return o.apply(t,e([this.value()],arguments))})}),t}var le,ue=1/0,ce=/[&<>"'`]/g,de=RegExp(ce.source),pe=/^(?:0|[1-9]\d*)$/,fe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},he={function:!0,object:!0},ve=he[typeof exports]&&exports&&!exports.nodeType?exports:le,ge=he[typeof module]&&module&&!module.nodeType?module:le,me=ge&&ge.exports===ve?ve:le,ye=r(he[typeof self]&&self),be=r(he[typeof window]&&window),we=r(he[typeof this]&&this),xe=r(ve&&ge&&"object"==typeof global&&global)||be!==(we&&we.window)&&be||ye||we||Function("return this")(),ke=Array.prototype,Te=Object.prototype,Se=Te.hasOwnProperty,Ce=0,$e=Te.toString,Ee=xe._,Ae=xe.Reflect,je=Ae?Ae.f:le,Ne=Object.create,De=Te.propertyIsEnumerable,Oe=xe.isFinite,He=Object.keys,qe=Math.max,Pe=function(e,t){return function(n,i){if(null==n)return n;if(!V(n))return e(n,i);for(var o=n.length,r=t?o:-1,s=Object(n);(t?r--:++r<o)&&!1!==i(s[r],r,s););return n}}(m),Le=function(e){return function(t,n,i){var o=-1,r=Object(t);i=i(t);for(var s=i.length;s--;){var a=i[e?s:++o];if(!1===n(r[a],a,r))break}return t}}();je&&!De.call({valueOf:1},"valueOf")&&(k=function(e){e=je(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n});var _e=$("length"),ze=U(function(t,n){return Re(t)||(t=null==t?[]:[Object(t)]),g(n,1),e(A(t),re)}),Ie=U(function(e,t,n){return q(e,t,n)}),Fe=U(function(e,t){return f(e,1,t)}),Me=U(function(e,t,n){return f(e,Be(t)||0,n)}),Re=Array.isArray,We=Number,Be=Number,Ue=O(function(e,t){D(t,ie(t),e)}),Xe=O(function(e,t){D(t,oe(t),e)}),Ye=O(function(e,t,n,i){D(t,oe(t),e,i)}),Ve=U(function(e){return e.push(le,d),Ye.apply(le,e)}),Ge=U(function(e,t){return null==e?{}:C(e,g(t,1))}),Qe=x;c.prototype=p(u.prototype),c.prototype.constructor=c,u.assignIn=Xe,u.before=B,u.bind=Ie,u.chain=function(e){return e=u(e),e.__chain__=!0,e},u.compact=function(e){return v(e,Boolean)},u.concat=ze,u.create=function(e,t){var n=p(e);return t?Ue(n,t):n},u.defaults=Ve,u.defer=Fe,u.delay=Me,u.filter=function(e,t){return v(e,x(t))},u.flatten=function(e){return e&&e.length?g(e,1):[]},u.flattenDeep=function(e){return e&&e.length?g(e,ue):[]},u.iteratee=Qe,u.keys=ie,u.map=function(e,t){return T(e,x(t))},u.matches=function(e){return S(Ue({},e))},u.mixin=ae,u.negate=function(e){if("function"!=typeof e)throw new TypeError("Expected a function");return function(){return!e.apply(this,arguments)}},u.once=function(e){return B(2,e)},u.pick=Ge,u.slice=function(e,t,n){var i=e?e.length:0;return n=n===le?i:+n,i?E(e,null==t?0:+t,n):[]},u.sortBy=function(e,t){var n=0;return t=x(t),T(T(e,function(e,i,o){return{c:e,b:n++,a:t(e,i,o)}}).sort(function(e,t){var n;e:{n=e.a;var i=t.a;if(n!==i){var o=null===n,r=n===le,s=n===n,a=null===i,l=i===le,u=i===i;if(n>i&&!a||!s||o&&!l&&u||r&&u){n=1;break e}if(i>n&&!o||!u||a&&!r&&s||l&&s){n=-1;break e}}n=0}return n||e.b-t.b}),$("c"))},u.tap=function(e,t){return t(e),e},u.thru=function(e,t){return t(e)},u.toArray=function(e){return V(e)?e.length?A(e):[]:re(e)},u.values=re,u.extend=Xe,ae(u,u),u.clone=function(e){return J(e)?Re(e)?A(e):D(e,ie(e)):e},u.escape=function(e){return(e=ne(e))&&de.test(e)?e.replace(ce,s):e},u.every=function(e,t,n){return t=n?le:t,h(e,x(t))},u.find=M,u.forEach=R,u.has=function(e,t){return null!=e&&Se.call(e,t)},u.head=F,u.identity=se,u.indexOf=function(e,t,n){var i=e?e.length:0;n="number"==typeof n?0>n?qe(i+n,0):n:0,n=(n||0)-1;for(var o=t===t;++n<i;){var r=e[n];if(o?r===t:r!==r)return n}return-1},u.isArguments=Y,u.isArray=Re,u.isBoolean=function(e){return!0===e||!1===e||Z(e)&&"[object Boolean]"==$e.call(e)},u.isDate=function(e){return Z(e)&&"[object Date]"==$e.call(e)},u.isEmpty=function(e){if(V(e)&&(Re(e)||ee(e)||G(e.splice)||Y(e)))return!e.length;for(var t in e)if(Se.call(e,t))return!1;return!0},u.isEqual=function(e,t){return b(e,t)},u.isFinite=function(e){return"number"==typeof e&&Oe(e)},u.isFunction=G,u.isNaN=function(e){return K(e)&&e!=+e},u.isNull=function(e){return null===e},u.isNumber=K,u.isObject=J,u.isRegExp=function(e){return J(e)&&"[object RegExp]"==$e.call(e)},u.isString=ee,u.isUndefined=function(e){return e===le},u.last=function(e){var t=e?e.length:0;return t?e[t-1]:le},u.max=function(e){return e&&e.length?t(e,se,X):le},u.min=function(e){return e&&e.length?t(e,se,te):le},u.noConflict=function(){return xe._===this&&(xe._=Ee),this},u.noop=function(){},u.reduce=W,u.result=function(e,t,n){return t=null==e?le:e[t],t===le&&(t=n),G(t)?t.call(e):t},u.size=function(e){return null==e?0:(e=V(e)?e:ie(e),e.length)},u.some=function(e,t,n){return t=n?le:t,j(e,x(t))},u.uniqueId=function(e){var t=++Ce;return ne(e)+t},u.each=R,u.first=F,ae(u,function(){var e={};return m(u,function(t,n){Se.call(u.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),u.VERSION="4.5.1",Pe("pop join replace reverse split push shift sort splice unshift".split(" "),function(e){var t=(/^(?:replace|split)$/.test(e)?String.prototype:ke)[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|join|replace|shift)$/.test(e);u.prototype[e]=function(){var e=arguments;return i&&!this.__chain__?t.apply(this.value(),e):this[n](function(n){return t.apply(n,e)})}}),u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=function(){return N(this.__wrapped__,this.__actions__)},(be||ye||{})._=u,"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return u}):ve&&ge?(me&&((ge.exports=u)._=u),ve._=u):xe._=u}.call(this),/*!

0 Likes
Highlighted
Shopify Partner
190 38 39

Hi @AYESHA2 

Can you please follow the instructions given by this territorials(https://www.shopify.in/partners/blog/jquery-image-zoom).

Thanks

Vishvas Mishra

For Design, Development and custom changes Hire Me.
If your problem solved then Like & Accept this Solution.
Email ID: technicalvishvas@gmail.com
0 Likes