D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
sanghavirealty
/
www
/
wp-content
/
plugins
/
sina-extension-for-elementor
/
assets
/
js
/
Filename :
xzoom.min.js
back
Copy
/*!----------------------------------------------------- * xZoom v1.0.14 * (c) 2013 by Azat Ahmedov & Elman Guseynov * https://github.com/payalord * https://dribbble.com/elmanvebs * Apache License 2.0 *------------------------------------------------------*/ function detect_old_ie(){if(!/MSIE (\d+\.\d+);/.test(navigator.userAgent))return!1;var o=new Number(RegExp.$1);return!(9<=o)&&(8<=o||(7<=o||(6<=o||(5<=o||void 0))))}window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(o){window.setTimeout(o,20)},function(Ao){function n(n,o){this.xzoom=!0;var i,a,p,l,d,s,r,c,h,f,u,v,m,g,w,x,b,z,k,y,C,O,M,A,S,H,W,F,I,T,X,Y,R,q,E,L,D,Z,_,j,N,t,Q,e,$,B,G,J,K,P,U,V=this,oo={},to=(new Array,new Array),eo=0,io=0,so=0,no=0,ao=0,po=0,lo=0,ro=0,co=0,ho=0,fo=0,uo=0,vo=0,mo=detect_old_ie(),go=/MSIE (\d+\.\d+);/.test(navigator.userAgent),wo="";function xo(){var o=document.documentElement;return{left:(window.pageXOffset||o.scrollLeft)-(o.clientLeft||0),top:(window.pageYOffset||o.scrollTop)-(o.clientTop||0)}}function bo(){if("circle"==V.options.lensShape&&"lens"==V.options.position){var o=((S=H=Math.max(S,H))+2*Math.max(T,I))/2;M.css({"-moz-border-radius":o,"-webkit-border-radius":o,"border-radius":o})}}function zo(o,t,e,i){"lens"==V.options.position?(O.css({top:-(t-r)*Y+H/2,left:-(o-c)*X+S/2}),V.options.bg&&(M.css({"background-image":"url("+O.attr("src")+")","background-repeat":"no-repeat","background-position":-(o-c)*X+S/2+"px "+(-(t-r)*Y+H/2)+"px"}),e&&i&&M.css({"background-size":e+"px "+i+"px"}))):O.css({top:-F*Y,left:-W*X})}function ko(o,t){var e,i;so<-1&&(so=-1),1<so&&(so=1),R<q?i=(e=l*(R-(R-1)*so))/E:e=(i=d*(q-(q-1)*so))*E,Z?(no=o,ao=t,po=e,lo=i):(Z||(ro=po=e,co=lo=i),S=l/(X=e/a),H=d/(Y=i/p),bo(),Co(o,t),O.width(e),O.height(i),M.width(S),M.height(H),M.css({top:F-T,left:W-I}),A.css({top:-F,left:-W}),zo(o,t,e,i))}function yo(){var o=ho,t=fo,e=uo,i=vo,s=ro,n=co;o+=(no-o)/V.options.smoothLensMove,t+=(ao-t)/V.options.smoothLensMove,e+=(no-e)/V.options.smoothZoomMove,i+=(ao-i)/V.options.smoothZoomMove,s+=(po-s)/V.options.smoothScale,n+=(lo-n)/V.options.smoothScale,S=l/(X=s/a),H=d/(Y=n/p),bo(),Co(o,t),O.width(s),O.height(n),M.width(S),M.height(H),M.css({top:F-T,left:W-I}),A.css({top:-F,left:-W}),Co(e,i),zo(o,t,s,n),ho=o,fo=t,uo=e,vo=i,ro=s,co=n,Z&&requestAnimFrame(yo)}function Co(o,t){W=(o-=c)-S/2,F=(t-=r)-H/2,"lens"!=V.options.position&&V.options.lensCollision&&(W<0&&(W=0),S<=a&&a-S<W&&(W=a-S),a<S&&(W=a/2-S/2),F<0&&(F=0),H<=p&&p-H<F&&(F=p-H),p<H&&(F=p/2-H/2))}function Oo(){void 0!==w&&w.remove(),void 0!==b&&b.remove(),void 0!==Q&&Q.remove()}function Mo(o){var t=o.attr("title"),e=o.attr("xtitle");return e||(t||"")}this.adaptive=function(){0!=B&&0!=G||(n.css("width",""),n.css("height",""),B=n.width(),G=n.height()),Oo(),e=Ao(window).width(),$=Ao(window).height(),J=n.width(),K=n.height();var o=!1;(e<B||$<G)&&(o=!0),B<J&&(J=B),G<K&&(K=G),o?n.width("100%"):0!=B&&n.width(B),"fullscreen"!=P&&(!function(){var o=n.offset();l="auto"==V.options.zoomWidth?J:V.options.zoomWidth;d="auto"==V.options.zoomHeight?K:V.options.zoomHeight;"#"==V.options.position.substr(0,1)?oo=Ao(V.options.position):oo.length=0;if(0!=oo.length)return!0;switch(P){case"lens":case"inside":return!0;case"top":r=o.top,c=o.left,h=r-d,f=c;break;case"left":r=o.top,c=o.left,h=r,f=c-l;break;case"bottom":r=o.top,c=o.left,h=r+K,f=c;break;case"right":default:r=o.top,c=o.left,h=r,f=c+J}return!(e<f+l||f<0)}()?V.options.position=V.options.mposition:V.options.position=P),V.options.lensReverse||(U=V.options.adaptiveReverse&&V.options.position==V.options.mposition)},this.xscroll=function(o){if(m=o.pageX||o.originalEvent.pageX,g=o.pageY||o.originalEvent.pageY,o.preventDefault(),o.xscale)so=o.xscale,ko(m,g);else{var t=-o.originalEvent.detail||o.originalEvent.wheelDelta||o.xdelta,e=m,i=g;mo&&(e=_,i=j),so+=t=0<t?-.05:.05,ko(e,i)}},this.openzoom=function(o){switch(m=o.pageX,g=o.pageY,V.options.adaptive&&V.adaptive(),so=V.options.defaultScale,Z=!1,w=Ao("<div></div>"),""!=V.options.sourceClass&&w.addClass(V.options.sourceClass),w.css("position","absolute"),z=Ao("<div></div>"),""!=V.options.loadingClass&&z.addClass(V.options.loadingClass),z.css("position","absolute"),x=Ao('<div style="position: absolute; top: 0; left: 0;"></div>'),w.append(z),b=Ao("<div></div>"),""!=V.options.zoomClass&&"fullscreen"!=V.options.position&&b.addClass(V.options.zoomClass),b.css({position:"absolute",overflow:"hidden",opacity:1}),V.options.title&&""!=wo&&(Q=Ao("<div></div>"),t=Ao("<div></div>"),Q.css({position:"absolute",opacity:1}),V.options.titleClass&&t.addClass(V.options.titleClass),t.html("<span>"+wo+"</span>"),Q.append(t),V.options.fadeIn&&Q.css({opacity:0})),M=Ao("<div></div>"),""!=V.options.lensClass&&M.addClass(V.options.lensClass),M.css({position:"absolute",overflow:"hidden"}),V.options.lens&&(lenstint=Ao("<div></div>"),lenstint.css({position:"absolute",background:V.options.lens,opacity:V.options.lensOpacity,width:"100%",height:"100%",top:0,left:0,"z-index":9999}),M.append(lenstint)),function(o,t){switch("fullscreen"==V.options.position?(a=Ao(window).width(),p=Ao(window).height()):(a=n.width(),p=n.height()),z.css({top:p/2-z.height()/2,left:a/2-z.width()/2}),(s=V.options.rootOutput||"fullscreen"==V.options.position?n.offset():n.position()).top=Math.round(s.top),s.left=Math.round(s.left),V.options.position){case"fullscreen":r=xo().top,c=xo().left,f=h=0;break;case"inside":r=s.top,c=s.left,f=h=0;break;case"top":r=s.top,c=s.left,h=r-d,f=c;break;case"left":r=s.top,c=s.left,h=r,f=c-l;break;case"bottom":r=s.top,c=s.left,h=r+p,f=c;break;case"right":default:r=s.top,c=s.left,h=r,f=c+a}r-=w.outerHeight()/2,c-=w.outerWidth()/2,"#"==V.options.position.substr(0,1)?oo=Ao(V.options.position):oo.length=0,0==oo.length&&"inside"!=V.options.position&&"fullscreen"!=V.options.position?(V.options.adaptive&&B&&G||(B=a,G=p),l="auto"==V.options.zoomWidth?a:V.options.zoomWidth,d="auto"==V.options.zoomHeight?p:V.options.zoomHeight,h+=V.options.Yoffset,f+=V.options.Xoffset,b.css({width:l+"px",height:d+"px",top:h,left:f}),"lens"!=V.options.position&&i.append(b)):"inside"==V.options.position||"fullscreen"==V.options.position?(l=a,d=p,b.css({width:l+"px",height:d+"px"}),w.append(b)):(l=oo.width(),d=oo.height(),V.options.rootOutput?(h=oo.offset().top,f=oo.offset().left,i.append(b)):(h=oo.position().top,f=oo.position().left,oo.parent().append(b)),h+=(oo.outerHeight()-d-b.outerHeight())/2,f+=(oo.outerWidth()-l-b.outerWidth())/2,b.css({width:l+"px",height:d+"px",top:h,left:f})),V.options.title&&""!=wo&&("inside"==V.options.position||"lens"==V.options.position||"fullscreen"==V.options.position?(u=h,v=f,w.append(Q)):(u=h+(b.outerHeight()-d)/2,v=f+(b.outerWidth()-l)/2,i.append(Q)),Q.css({width:l+"px",height:d+"px",top:u,left:v})),w.css({width:a+"px",height:p+"px",top:r,left:c}),x.css({width:a+"px",height:p+"px"}),V.options.tint&&"inside"!=V.options.position&&"fullscreen"!=V.options.position?x.css("background-color",V.options.tint):mo&&x.css({"background-image":"url("+n.attr("src")+")","background-color":"#fff"}),C=new Image;var e="";switch(go&&(e="?r="+(new Date).getTime()),C.src=n.data("xoriginal")+e,(O=Ao(C)).css("position","absolute"),(C=new Image).src=n.attr("src"),(A=Ao(C)).css("position","absolute"),A.width(a),V.options.position){case"fullscreen":case"inside":b.append(O);break;case"lens":M.append(O),V.options.bg&&O.css({display:"none"});break;default:b.append(O),M.append(A)}}(),"inside"!=V.options.position&&"fullscreen"!=V.options.position?((V.options.tint||mo)&&w.append(x),V.options.fadeIn&&(x.css({opacity:0}),M.css({opacity:0}),b.css({opacity:0}))):V.options.fadeIn&&b.css({opacity:0}),i.append(w),V.eventmove(w),V.eventleave(w),V.options.position){case"inside":h-=(b.outerHeight()-b.height())/2,f-=(b.outerWidth()-b.width())/2;break;case"top":h-=b.outerHeight()-b.height(),f-=(b.outerWidth()-b.width())/2;break;case"left":h-=(b.outerHeight()-b.height())/2,f-=b.outerWidth()-b.width();break;case"bottom":f-=(b.outerWidth()-b.width())/2;break;case"right":h-=(b.outerHeight()-b.height())/2}b.css({top:h,left:f}),O.xon("load",function(o){if(z.remove(),!V.options.openOnSmall&&(O.width()<l||O.height()<d))return V.closezoom(),o.preventDefault(),!1;V.options.scroll&&V.eventscroll(w),"inside"!=V.options.position&&"fullscreen"!=V.options.position?(w.append(M),V.options.fadeIn?(x.fadeTo(300,V.options.tintOpacity),M.fadeTo(300,1),b.fadeTo(300,1)):(x.css({opacity:V.options.tintOpacity}),M.css({opacity:1}),b.css({opacity:1}))):V.options.fadeIn?b.fadeTo(300,1):b.css({opacity:1}),V.options.title&&""!=wo&&(V.options.fadeIn?Q.fadeTo(300,1):Q.css({opacity:1})),L=O.width(),D=O.height(),V.options.adaptive&&(a<B||p<G)&&(A.width(a),A.height(p),L*=a/B,D*=p/G,O.width(L),O.height(D)),ro=po=L,co=lo=D,E=L/D,R=L/l,q=D/d;var t,e=["padding-","border-"];T=I=0;for(var i=0;i<e.length;i++)t=parseFloat(M.css(e[i]+"top-width")),T+=t!=t?0:t,t=parseFloat(M.css(e[i]+"bottom-width")),T+=t!=t?0:t,t=parseFloat(M.css(e[i]+"left-width")),I+=t!=t?0:t,t=parseFloat(M.css(e[i]+"right-width")),I+=t!=t?0:t;T/=2,I/=2,uo=ho=no=m,vo=fo=ao=g,ko(m,g),V.options.smooth&&(Z=!0,requestAnimFrame(yo)),V.eventclick(w)})},this.movezoom=function(o){m=o.pageX,g=o.pageY,mo&&(_=m,j=g);var t=m-c,e=g-r;U&&(o.pageX-=2*(t-a/2),o.pageY-=2*(e-p/2)),(t<0||a<t||e<0||p<e)&&w.trigger("mouseleave"),V.options.smooth?(no=o.pageX,ao=o.pageY):(bo(),Co(o.pageX,o.pageY),M.css({top:F-T,left:W-I}),A.css({top:-F,left:-W}),zo(o.pageX,o.pageY,0,0))},this.eventdefault=function(){V.eventopen=function(o){o.xon("mouseenter",V.openzoom)},V.eventleave=function(o){o.xon("mouseleave",V.closezoom)},V.eventmove=function(o){o.xon("mousemove",V.movezoom)},V.eventscroll=function(o){o.xon("mousewheel DOMMouseScroll",V.xscroll)},V.eventclick=function(o){o.xon("click",function(o){n.trigger("click")})}},this.eventunbind=function(){n.xoff("mouseenter"),V.eventopen=function(o){},V.eventleave=function(o){},V.eventmove=function(o){},V.eventscroll=function(o){},V.eventclick=function(o){}},this.init=function(o){V.options=Ao.extend({},Ao.fn.xzoom.defaults,o),i=V.options.rootOutput?Ao("body"):n.parent(),P=V.options.position,U=V.options.lensReverse&&"inside"==V.options.position,V.options.smoothZoomMove<1&&(V.options.smoothZoomMove=1),V.options.smoothLensMove<1&&(V.options.smoothLensMove=1),V.options.smoothScale<1&&(V.options.smoothScale=1),V.options.adaptive&&Ao(window).xon("load",function(){B=n.width(),G=n.height(),V.adaptive(),Ao(window).resize(V.adaptive)}),V.eventdefault(),V.eventopen(n)},this.destroy=function(){V.eventunbind()},this.closezoom=function(){Z=!1,V.options.fadeOut?(V.options.title&&""!=wo&&Q.fadeOut(299),("inside"!=V.options.position||"fullscreen"!=V.options.position)&&b.fadeOut(299),w.fadeOut(300,function(){Oo()})):Oo()},this.gallery=function(){var o,t=new Array,e=0;for(o=io;o<to.length;o++)t[e]=to[o],e++;for(o=0;o<io;o++)t[e]=to[o],e++;return{index:io,ogallery:to,cgallery:t}},this.xappend=function(i){var s=i.parent();function o(o){Oo(),o.preventDefault(),V.options.activeClass&&(N.removeClass(V.options.activeClass),(N=i).addClass(V.options.activeClass)),io=Ao(this).data("xindex"),V.options.fadeTrans&&((y=new Image).src=n.attr("src"),(k=Ao(y)).css({position:"absolute",top:n.offset().top,left:n.offset().left,width:n.width(),height:n.height()}),Ao(document.body).append(k),k.fadeOut(200,function(){k.remove()}));var t=s.data("link"),e=i.data("xpreview")||i.attr("src");wo=Mo(i),i.attr("title")&&n.attr("title",i.attr("title")),n.data("xoriginal",t),n.removeAttr("style"),n.attr("src",e),V.options.adaptive&&(B=n.width(),G=n.height())}to[eo]=s.data("link"),s.data("xindex",eo),0==eo&&V.options.activeClass&&(N=i).addClass(V.options.activeClass),0==eo&&V.options.title&&(wo=Mo(i)),eo++,V.options.hover&&s.xon("mouseenter",s,o),s.xon("click",s,o)},this.init(o)}Ao.fn.xon=Ao.fn.on||Ao.fn.bind,Ao.fn.xoff=Ao.fn.off||Ao.fn.bind,Ao.fn.xzoom=function(t){var e,i;if(this.selector){var s=this.selector.split(",");for(var o in s)s[o]=Ao.trim(s[o]);this.each(function(o){if(1==s.length)if(0==o){if(void 0!==(e=Ao(this)).data("xzoom"))return e.data("xzoom");e.x=new n(e,t)}else void 0!==e.x&&(i=Ao(this),e.x.xappend(i));else if(Ao(this).is(s[0])&&0==o){if(void 0!==(e=Ao(this)).data("xzoom"))return e.data("xzoom");e.x=new n(e,t)}else void 0===e.x||Ao(this).is(s[0])||(i=Ao(this),e.x.xappend(i))})}else this.each(function(o){if(0==o){if(void 0!==(e=Ao(this)).data("xzoom"))return e.data("xzoom");e.x=new n(e,t)}else void 0!==e.x&&(i=Ao(this),e.x.xappend(i))});return void 0!==e&&(e.data("xzoom",e.x),Ao(e).trigger("xzoom_ready"),e.x)},Ao.fn.xzoom.defaults={position:"right",mposition:"inside",rootOutput:!0,Xoffset:0,Yoffset:0,fadeIn:!0,fadeTrans:!0,fadeOut:!1,smooth:!0,smoothZoomMove:3,smoothLensMove:1,smoothScale:6,defaultScale:0,scroll:!0,tint:!1,tintOpacity:.5,lens:!1,lensOpacity:.5,lensShape:"box",lensCollision:!0,lensReverse:!1,openOnSmall:!0,zoomWidth:"auto",zoomHeight:"auto",sourceClass:"xzoom-source",loadingClass:"xzoom-loading",lensClass:"xzoom-lens",zoomClass:"xzoom-preview",activeClass:"xactive",hover:!1,adaptive:!0,adaptiveReverse:!1,title:!1,titleClass:"xzoom-caption",bg:!1}}(jQuery);