1!function($){if(void 0!==$){var defaultConfig={num:3,maxWidth:250,maxHeight:150,autoPlay:!0,showTime:1e3,animationTime:300,scale:.8,distance:50};$.fn.carousel=function(param){var config,totalNum,$target;$(this).each(function(index,target){if($target=$(target),"object"==typeof param&&null!==param){if(config=function(newConfig){var config=null;if("object"==typeof newConfig&&null!==newConfig){for(var prop in config={},defaultConfig)defaultConfig.hasOwnProperty(prop)&&(config[prop]=defaultConfig[prop]);for(prop in newConfig)newConfig.hasOwnProperty(prop)&&config.hasOwnProperty(prop)&&(config[prop]=newConfig[prop])}return config}(param),(totalNum=$target.find("ul li").length)<=0||totalNum%2==0)return;(config.num<=0||config.num>totalNum)&&(config.num=totalNum),$target.data("config",config),$target.data("index",0),$target.data("totalNum",totalNum),function($container){var scales,showIndexsInfo=getShowIndexs($container),zIndex=9999,config=$container.data("config"),halfShowNum=(config.num-1)/2,listWidth=halfShowNum*config.distance*2+config.maxWidth,containerWidth=$container.width(),containerHeight=$container.height();containerWidth<listWidth&&$container.width(listWidth),containerHeight<config.maxHeight&&$container.height(config.maxHeight),$container.find("ul li img").css({width:"100%",height:"100%"}),$container.find("ul").css({position:"relative",width:listWidth,height:config.maxHeight,"list-style":"none",padding:0,margin:0,marginLeft:"50%",left:-listWidth/2,top:($container.height()-config.maxHeight)/2}),$container.find(".left").css({position:"absolute",left:10,top:"50%","z-index":9999+$container.data("totalNum")+1}),$container.find(".right").css({position:"absolute",right:10,top:"50%","z-index":9999+$container.data("totalNum")+1}),$container.find("ul li").each(function(index,element){var i=showIndexsInfo.hashIndexs[index];void 0!==i?(scales=Math.pow(config.scale,Math.abs(i-halfShowNum)),zIndex=9999+(i>halfShowNum?config.num-1-i:i),$(element).css({display:"block",position:"absolute","z-index":zIndex,overflow:"hidden",width:scales*config.maxWidth,height:scales*config.maxHeight,left:i*config.distance+(1-scales)*config.maxWidth*Number(i>halfShowNum),top:(1-scales)*config.maxHeight/2})):(scales=Math.pow(config.scale,halfShowNum),$(element).css({display:"none",position:"absolute",overflow:"hidden",width:scales*config.maxWidth,height:scales*config.maxHeight,left:halfShowNum*config.distance+(1-scales)*config.maxWidth/2,top:0}))})}($target),$target.find(".left").off("click").on("click",function($target){return function(){scroll($target,"left")}}($target)),$target.find(".right").off("click").on("click",function($target){return function(){scroll($target,"right")}}($target)),function($target){var autoPlay;clearInterval($target.data("auto")),$target.data("config").autoPlay?(autoPlay=setInterval(function(){scroll($target,"right")},$target.data("config").showTime),$target.data("auto",autoPlay),$target.find("ul").off("mouseenter").on("mouseenter",function(){clearInterval($target.data("auto"))}).off("mouseleave").on("mouseleave",function(){autoPlay=setInterval(function(){scroll($target,"right")},$target.data("config").showTime),$target.data("auto",autoPlay)})):$target.find("ul").off("mouseenter").off("mouseleave")}($target)}})}}function scroll($container,direction){if(!$container.data("isanimating")){var scales,i,newIndex,targetCss,firstIndexBeforeScroll,lastIndexBeforeScroll,config=$container.data("config"),halfShowNum=(config.num-1)/2,totalNum=$container.data("totalNum");if("left"===direction)newIndex=($container.data("index")-1+totalNum)%totalNum;else{if("right"!==direction)return;newIndex=($container.data("index")+1)%$container.data("totalNum")}var tempIndexsInfo=getShowIndexs($container);firstIndexBeforeScroll=tempIndexsInfo.indexs[0],lastIndexBeforeScroll=tempIndexsInfo.indexs[config.num-1],$container.data("index",newIndex);var showIndexsInfo=getShowIndexs($container),zIndexs=function(num,direction){for(var zIndexs=[],i=0;i<num;i++)i<=(num-1)/2?zIndexs.push(i):zIndexs.push((num-1)/2-i);return"left"===direction?(zIndexs.reverse(),zIndexs):"right"===direction?zIndexs:void 0}(config.num,direction);totalNum===config.num?animationTimeForEdge=0:totalNum-config.num===2?animationTimeForEdge=config.animationTime/2:animationTimeForEdge=config.animationTime,$container.find("ul li").each(function(index,element){void 0!==(i=showIndexsInfo.hashIndexs[index])?(scales=Math.pow(config.scale,Math.abs(i-halfShowNum)),$container.data("isanimating",!0),$(element).css({display:"block","z-index":zIndexs[i]+9999}).animate({width:scales*config.maxWidth,height:scales*config.maxHeight,left:i*config.distance+(1-scales)*config.maxWidth*Number(i>halfShowNum),top:(1-scales)*config.maxHeight/2},config.animationTime,function(){$container.data("isanimating",!1)})):(scales=Math.pow(config.scale,halfShowNum),targetCss={display:"none",left:halfShowNum*config.distance+(1-scales)*config.maxWidth/2,top:0},"left"===direction&&index===lastIndexBeforeScroll?$(element).css("z-index",-1).animate({left:"-="+config.distance+"px"},config.animationTime,function(){$(element).css(targetCss)}):"right"===direction&&index===firstIndexBeforeScroll?$(element).css("z-index",-1).animate({left:"+="+config.distance+"px"},config.animationTime,function(){$(element).css(targetCss)}):$(element).css({display:"none",width:scales*config.maxWidth,height:scales*config.maxHeight,left:halfShowNum*config.distance+(1-scales)*config.maxWidth/2,top:0}))})}}function getShowIndexs($container){for(var temp,showIndexs=[],halfShowNum=($container.data("config").num-1)/2,currentIndex=$container.data("index")||0,totalNum=$container.data("totalNum")||0,i=-halfShowNum;i<=halfShowNum;i++)temp=currentIndex+i,showIndexs.push((temp<0?temp+totalNum:temp)%totalNum);var hashIndexs={};for(i=0;i<showIndexs.length;i++)hashIndexs[showIndexs[i]]=i;return{indexs:showIndexs,hashIndexs:hashIndexs}}}(jQuery); 2//# sourceURL=https://143223009.fs1.hubspotusercontent-eu1.net/hubfs/143223009/hub_generated/template_assets/1/105742467281/1791298186295/template_carousel.js
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.