text: (function(b,p,r,t){var e=function(a,c){this.$ele=a;this.flag=!1;this.middleImgSrc=this.bigImgSrc="";this.$samllImgBox=this.$ele.find(".imgzoom-triggle");this.$middlImgBox=this.$ele.find(".zoom-middle-img");this.$bigImgBox=this.$ele.find(".zoom-big-img");this.$zoomtrigger=this.$ele.find(".mousetrap");this.defaults={index:0,trigger:a.attr("data-trigger")&&"hover"==a.attr("data-trigger")?"hover":"click",handleRage:2};this.settings=b.extend({},this.defaults,c);this.init()};e.prototype={construct:e,init:function(){this.$samllImgBox.eq(this.settings.index).parent("li").addClass("cpActive ").siblings().removeClass("cpActive ");this.bigImgSrc=this.$samllImgBox.eq(this.settings.index).attr("href");this.middleImgSrc=this.$samllImgBox.eq(this.settings.index).attr("data-middleimg");this.setImgSrc(this.middleImgSrc,this.bigImgSrc);this.changeImg();this.move()},move:function(){var a=this,c=this.$zoomtrigger.width(),l=this.$zoomtrigger.height(),d=this.$bigImgBox.width(),e=this.$bigImgBox.width();this.$zoomtrigger.mouseenter(function(){b(this);c=a.$middlImgBox.width();l=a.$middlImgBox.height();d=a.$bigImgBox.width();e=a.$bigImgBox.height();a.loadImg(a.middleImgSrc,function(d,e){a.flag=!0;if(0==a.$middlImgBox.find(".zoom-range").length){var f=b("\x3cdiv\x3e");f.addClass("zoom-range");f.css({width:c/a.settings.handleRage,height:l/a.settings.handleRage});a.$middlImgBox.append(f)}})});this.$zoomtrigger.mousemove(function(k){if(a.flag){k=k||p.event;var q=b(".zoom-range").width(),f=b(".zoom-range").height(),m=c-q,n=l-f,g=k.pageX-a.$middlImgBox.offset().left-q/2,h=k.pageY-a.$middlImgBox.offset().top-f/2;0>g?g=0:g>m&&(g=m);0>h?h=0:h>n&&(h=n);a.loadImg(a.bigImgSrc,function(c,b){a.$bigImgBox.show();a.$bigImgBox.css("background-position",(c-d)*-(g/m)+"px "+(b-e)*-(h/n)+"px")});b(".zoom-range").css({left:g,top:h})}});this.$middlImgBox.mouseout(function(){console.log(a);a.flag=!1;a.$middlImgBox.find(".zoom-range").remove();a.$bigImgBox.css({display: 'none'})})},changeImg:function(){var a=this;"click"==a.settings.trigger?a.$samllImgBox.click(function(c){c=c||p.event;c.preventDefault();b(this).parent().addClass("cpActive ").siblings().removeClass("cpActive ");a.bigImgSrc=b(this).attr("href");a.middleImgSrc=b(this).attr("data-middleimg");a.setImgSrc(a.middleImgSrc,a.bigImgSrc);a.loadImg(a.middleImgSrc,function(a,c){})}):(a.$samllImgBox.click(function(a){a=a||event;a.preventDefault()}),a.$samllImgBox.mouseenter(function(c){c=c||event;c.preventDefault();b(this).parent().addClass("cpActive ").siblings().removeClass("cpActive ");a.bigImgSrc=b(this).attr("href");a.middleImgSrc=b(this).attr("data-middleimg");a.setImgSrc(a.middleImgSrc,a.bigImgSrc);a.loadImg(a.middleImgSrc,function(a,c){})}))},loadImg:function(a,c){var b=this,d=new Image;d.src=a;0==b.$middlImgBox.find(".isLoading").length&&b.$middlImgBox.append('\x3cdiv class\x3d"isLoading"\x3e\x3c/div\x3e');d.complete?(b.$middlImgBox.find(".isLoading").remove(),c(d.width,d.height)):d.onload=function(){b.$middlImgBox.find(".isLoading").remove();c(d.width,d.height)}},setImgSrc:function(a,b){this.$middlImgBox.find(".middle-img").children("img").attr("src",a);this.$bigImgBox.css({background:'url("'+b+'") no-repeat'})}};b.fn.ImgZoom=function(a){return this.each(function(){new e(b(this),a)})};b(function(){b(".m_imgZoom").ImgZoom()})})(jQuery,window,document);