%PDF- %PDF-
Direktori : /proc/thread-self/root/proc/self/root/home/medipszd/public_html/magnify/ |
Current File : //proc/thread-self/root/proc/self/root/home/medipszd/public_html/magnify/magnify.min.js |
!function(i){i.fn.magnify=function(t){t=i.extend({src:"",speed:100,timeout:-1,finalWidth:null,finalHeight:null,magnifiedWidth:null,magnifiedHeight:null,limitBounds:!1,afterLoad:function(){}},t);var e=this,n=i("html"),a=function(e){var a=i(e),o=a.closest("a"),s={};for(var f in t)s[f]=a.attr("data-magnify-"+f.toLowerCase());var l=s.src||t.src||o.attr("href")||"";if(l){var d,c,u,h,g,m,p,v,y,w,N=0,b=0,k=function(){var i=d.offset();return w={top:a.offset().top-i.top+parseInt(a.css("border-top-width"))+parseInt(a.css("padding-top")),left:a.offset().left-i.left+parseInt(a.css("border-left-width"))+parseInt(a.css("padding-left"))},i.top+=w.top,i.left+=w.left,i},H=function(){c.is(":visible")&&c.fadeOut(t.speed,function(){n.removeClass("magnifying").trigger("magnifyend")})};isNaN(+s.speed)||(t.speed=+s.speed),isNaN(+s.timeout)||(t.timeout=+s.timeout),isNaN(+s.finalWidth)||(t.finalWidth=+s.finalWidth),isNaN(+s.finalHeight)||(t.finalHeight=+s.finalHeight),isNaN(+s.magnifiedWidth)||(t.magnifiedWidth=+s.magnifiedWidth),isNaN(+s.magnifiedHeight)||(t.magnifiedHeight=+s.magnifiedHeight),"true"===s.limitBounds&&(t.limitBounds=!0),"function"==typeof window[s.afterLoad]&&(t.afterLoad=window[s.afterLoad]),a.data("originalStyle",a.attr("style"));var W=new Image;i(W).on({load:function(){var e,f;a.css("display","block"),a.parent(".magnify").length||a.wrap('<div class="magnify"></div>'),d=a.parent(".magnify"),a.prev(".magnify-lens").length?d.children(".magnify-lens").css("background-image","url('"+l+"')"):a.before('<div class="magnify-lens loading" style="background:url(\''+l+"') 0 0 no-repeat\"></div>"),(c=d.children(".magnify-lens")).removeClass("loading"),u=t.finalWidth||a.width(),h=t.finalHeight||a.height(),g=t.magnifiedWidth||W.width,m=t.magnifiedHeight||W.height,p=c.width(),v=c.height(),y=k(),t.limitBounds&&(N=p/2/(g/u),b=v/2/(m/h)),g===W.width&&m===W.height||c.css("background-size",g+"px "+m+"px"),a.data("zoomSize",{width:g,height:m}),W=null,t.afterLoad(),d.off().on({"mousemove touchmove":function(i){if(i.preventDefault(),h){if(e=(i.pageX||i.originalEvent.touches[0].pageX)-y.left,f=(i.pageY||i.originalEvent.touches[0].pageY)-y.top,c.is(":animated")||(e>N&&e<u-N&&f>b&&f<h-b?c.is(":hidden")&&(n.addClass("magnifying").trigger("magnifystart"),c.fadeIn(t.speed)):H()),c.is(":visible")){var a="";if(g&&m){var o=-Math.round(e/u*g-p/2),s=-Math.round(f/h*m-v/2);if(t.limitBounds){var l=-Math.round((u-N)/u*g-p/2),d=-Math.round((h-b)/h*m-v/2);o>0?o=0:o<l&&(o=l),s>0?s=0:s<d&&(s=d)}a=o+"px "+s+"px"}c.css({top:Math.round(f-v/2)+w.top+"px",left:Math.round(e-p/2)+w.left+"px","background-position":a})}}else r()},mouseenter:function(){y=k()},mouseleave:H}),t.timeout>=0&&d.on("touchend",function(){setTimeout(H,t.timeout)}),i("body").not(d).on("touchstart",H);var x=a.attr("usemap");if(x){var I=i("map[name="+x.slice(1)+"]");a.after(I),d.click(function(t){if(t.clientX||t.clientY){c.hide();var n=document.elementFromPoint(t.clientX||t.originalEvent.touches[0].clientX,t.clientY||t.originalEvent.touches[0].clientY);"AREA"===n.nodeName?n.click():i("area",I).each(function(){var t=i(this).attr("coords").split(",");if(e>=t[0]&&e<=t[2]&&f>=t[1]&&f<=t[3])return this.click(),!1})}})}o.length&&(o.css("display","inline-block"),!o.attr("href")||s.src||t.src||o.click(function(i){i.preventDefault()}))},error:function(){W=null}}),W.src=l}},o=0,r=function(){clearTimeout(o),o=setTimeout(function(){e.destroy(),e.magnify(t)},100)};return this.destroy=function(){return this.each(function(){var t=i(this),e=t.prev("div.magnify-lens"),n=t.data("originalStyle");t.parent("div.magnify").length&&e.length&&(n?t.attr("style",n):t.removeAttr("style"),t.unwrap(),e.remove())}),i(window).off("resize",r),e},i(window).resize(r),this.each(function(){a(this)})}}(jQuery);