text: (function(a){var b=function(c){var d=this;d.touchObject={};d.ImgSlider=c;d.touchObject.prevDomNode=true;d.btnList=a("[node-type=btn-list]",c);d.imgUlConter=a("[node-type=img-contenter]",c);d.imgLiList=a("[node-type=img-list]",c);d.setting={autoAnimate:true,btnShow:true,btnClick:true,touchMove:true,changeTime:3000,animateType:"ease-in",animateTime:500,sweepTime:400};a.extend(d.setting,d.getUserSetting());d.addLiValue();if(d.setting.autoAnimate){if(d.imgLiList.length>1){d.startAnimate()}}if(d.setting.btnShow){d.showChangeBtn()}if(d.setting.btnClick){a(d.ImgSlider).on("tap","li",function(){d.stopAnimate();d.trigBtnIndex=a(this).find("a").text();d.btnChangeImg();setTimeout(function(){d.startAnimate()},0)})}if(d.setting.touchMove){a(d.ImgSlider).on("touchstart","li",function(){d.stopAnimate();d.touchObject.currDomNode=this;d.touchStart.call(d)});a(d.ImgSlider).on("touchmove","li",function(){d.touchMove.call(d)});a(d.ImgSlider).on("touchend","li",function(){d.touchEnd.call(d);d.startAnimate()})}};b.prototype={slConWidth:function(){return this.ImgSlider.width()},showChangeBtn:function(){if(this.imgLiList.length<=1){return false}else{this.btnList.css({display:"list-item","list-style-type":"none"})}},addLiValue:function(){a.each(this.imgLiList,function(c,d){a(d).attr("value-type",c)})},startAnimate:function(){var e=this;var c=e.imgUlConter;e.imgInterval=setInterval(function(){c.animate({translate3d:"-"+e.slConWidth()+"px,0,0"},e.setting.animateTime,e.setting.animateType,d)},e.setting.changeTime);function d(){setTimeout(function(){e.appendHtml()},0)}},appendHtml:function(){var c=a("[node-type=img-list]",this.ImgSlider);var d=c.eq(0);this.imgUlConter.append(d);this.changeBtnClass();this.imgUlConter.css("transform","translate3d(0,0,0)")},changeBtnClass:function(d){var c=a("[node-type=img-list]",this.ImgSlider);this.btnList.removeClass("current-btn");this.btnList.eq(Number(c.eq(0).attr("value-type"))).addClass("current-btn")},btnChangeImg:function(){var h=this;var g=h.trigBtnIndex-1;var c=h.imgLiList;var f=[];var d=a("[class=current-btn]",h.ImgSlider).text()-1;var e=a("[node-type=img-list]",h.ImgSlider);if(d>g){a.each(e,function(j,k){var i=Number(a(k).attr("value-type"));if(i<d&&i>=g){f.push(k)}});h.imgUlConter.prepend(a(f)).css("transform","translate3d(0,0,0)")}else{a.each(c,function(j,k){if(a(k).attr("value-type")<g){f.push(k)}});h.imgUlConter.append(a(f)).css("transform","translate3d(0,0,0)")}a(c).removeClass("current-btn");h.changeBtnClass(g)},touchStart:function(){var c=new Date();this.touchObject.startX=event.touches[0].pageX;this.touchObject.startY=event.touches[0].pageY;this.touchObject.startTime=c.getTime()},touchMove:function(){var f,d,c;var e=a("[node-type=img-list]",this.ImgSlider);f=this.touchObject;f.moveX=event.touches[0].pageX;f.moveY=event.touches[0].pageY;f.tempMoveX=f.moveX-f.startX;f.tempMoveY=f.moveY-f.startY;if(f.tempMoveX>0){if(f.prevDomNode){this.imgUlConter.prepend(e.eq(e.length-1)).css("transform","translate3d(-"+this.slConWidth()+"px,0,0)");f.prevDomNode=false}this.moveRight()}if(f.tempMoveX<0){this.moveLeft()}},touchEnd:function(){var f,c,e;var d=new Date();f=this.touchObject;c=this.slConWidth()/2;f.prevDomNode=true;f.endTime=d.getTime();e=f.endTime-f.startTime;if(e<this.setting.sweepTime){this.sweepFunc()}else{if(f.tempMoveX<0){if(Math.abs(f.tempMoveX)>c){this.originLeft()}else{this.originRight()}}else{if(Math.abs(f.tempMoveX)>c){this.originRight()}else{this.originLeft()}}}},moveLeft:function(){this.imgUlConter.css("transform","translate3d("+this.touchObject.tempMoveX+"px,0,0)")},moveRight:function(){var c=this.slConWidth()-this.touchObject.tempMoveX;this.imgUlConter.css("transform","translate3d(-"+c+"px,0,0)")},sweepFunc:function(){if(this.touchObject.tempMoveX<0){this.originLeft()}else{this.originRight()}},originRight:function(){this.imgUlConter.animate({translate3d:"0,0,0"},this.setting.animateTime/2,this.setting.animateType)},originLeft:function(){var c=this;c.imgUlConter.animate({translate3d:"-"+c.slConWidth()+"px,0,0"},c.setting.animateTime/2,c.setting.animateType,function(){c.appendHtml()})},stopAnimate:function(){var c=this;clearTimeout(c.imgInterval)},getUserSetting:function(){var c=this.ImgSlider.attr("user-setting");if(c&&c!==""){return a.parseJSON(c)}else{return{}}},destoryFunc:function(){}};b.init=function(c){var d=this;c.each(function(){new d(a(this))})};window.SliderImgFunc=b})(Zepto);