(function($){ $.fn.slide=function(options){ $.fn.slide.defaults={ type:"slide", effect:"fade", autoplay:false, delaytime:500, intertime:2500, triggertime:150, defaultindex:0, titcell:".hd li", maincell:".bd", targetcell:null, trigger:"mouseover", scroll:1, vis:1, titonclassname:"on", autopage:false, prevcell:".prev", nextcell:".next", pagestatecell:".pagestate", opp: false, pnloop:true, easing:"swing", startfun:null, endfun:null, switchload:null, playstatecell:".playstate", mouseoverstop:true, defaultplay:true, returndefault:false }; return this.each(function() { var opts = $.extend({},$.fn.slide.defaults,options); var slider = $(this); var effect = opts.effect; var prevbtn = $(opts.prevcell, slider); var nextbtn = $(opts.nextcell, slider); var pagestate = $(opts.pagestatecell, slider); var playstate = $(opts.playstatecell, slider); var navobj = $(opts.titcell, slider);//导航子元素结合 var navobjsize = navobj.size(); var conbox = $(opts.maincell , slider);//内容元素父层对象 var conboxsize=conbox.children().size(); var sload=opts.switchload; var tarobj = $(opts.targetcell, slider); /*字符串转换*/ var index=parseint(opts.defaultindex); var delaytime=parseint(opts.delaytime); var intertime=parseint(opts.intertime); var triggertime=parseint(opts.triggertime); var scroll=parseint(opts.scroll); var vis=parseint(opts.vis); var autoplay = (opts.autoplay=="false"||opts.autoplay==false)?false:true; var opp = (opts.opp=="false"||opts.opp==false)?false:true; var autopage = (opts.autopage=="false"||opts.autopage==false)?false:true; var pnloop = (opts.pnloop=="false"||opts.pnloop==false)?false:true; var mouseoverstop = (opts.mouseoverstop=="false"||opts.mouseoverstop==false)?false:true; var defaultplay = (opts.defaultplay=="false"||opts.defaultplay==false)?false:true; var returndefault = (opts.returndefault=="false"||opts.returndefault==false)?false:true; var slideh=0; var slidew=0; var selfw=0; var selfh=0; var easing=opts.easing; var inter=null;//autoplay-setinterval var mst =null;//trigger-settimeout var rtnst=null;//returndefault-settimeout var titon = opts.titonclassname; var onindex = navobj.index( slider.find( "."+titon) ); var oldindex = index = defaultindex = onindex==-1?index:onindex; var _ind = index; var clonenum = conboxsize>=vis?( conboxsize%scroll!=0?conboxsize%scroll:scroll):0; var _tar; var ismarq = effect=="leftmarquee" || effect=="topmarquee"?true:false; var dostartfun=function(){ if ( $.isfunction( opts.startfun) ){ opts.startfun( index,navobjsize,slider,$(opts.titcell, slider),conbox,tarobj,prevbtn,nextbtn ) } } var doendfun=function(){ if ( $.isfunction( opts.endfun ) ){ opts.endfun( index,navobjsize,slider,$(opts.titcell, slider),conbox,tarobj,prevbtn,nextbtn ) } } var reseton=function(){ navobj.removeclass(titon); if( defaultplay ) navobj.eq(defaultindex).addclass(titon) } //单独处理菜单效果 if( opts.type=="menu" ){ if( defaultplay ){ navobj.removeclass(titon).eq(index).addclass(titon); } navobj.hover( function(){ _tar=$(this).find( opts.targetcell ); var hoverind =navobj.index($(this)); mst = settimeout(function(){ index=hoverind; navobj.removeclass(titon).eq (index).addclass(titon); dostartfun(); switch (effect) { case "fade":_tar.stop(true,true).animate({opacity:"show"}, delaytime,easing,doendfun ); break; case "slidedown":_tar.stop(true,true).animate({height:"show"}, delaytime,easing,doendfun ); break; } } ,opts.triggertime); },function(){ cleartimeout(mst); switch (effect){ case "fade":_tar.animate( {opacity:"hide"},delaytime,easing ); break; case "slidedown":_tar.animate( {height:"hide"},delaytime,easing ); break; } } ); if (returndefault){ slider.hover(function(){cleartimeout(rtnst);},function(){ rtnst = settimeout( reseton,delaytime ); }); } return; } //处理分页 if( navobjsize==0 )navobjsize=conboxsize;//只有左右按钮 if( ismarq ) navobjsize=2; if( autopage ){ if(conboxsize>=vis){ if( effect=="leftloop" || effect=="toploop" ){ navobjsize=conboxsize%scroll!=0?(conboxsize/scroll^0)+1:conboxsize/scroll; } else{ var temps = conboxsize-vis; navobjsize=1+parseint(temps%scroll!=0?(temps/scroll+1):(temps/scroll)); if(navobjsize<=0)navobjsize=1; } } else{ navobjsize=1 } navobj.html(""); var str=""; if( opts.autopage==true || opts.autopage=="true" ){ for( var i=0; i" } } else{ for( var i=0; i=vis){ //当内容个数少于可视个数,不执行效果。 conbox.children().each(function(){ //取最大值 if( $(this).width()>selfw ){ selfw=$(this).width(); slidew=$(this).outerwidth(true); } if( $(this).height()>selfh ){ selfh=$(this).height(); slideh=$(this).outerheight(true); } }); var _chr = conbox.children(); var cloneele = function(){ for( var i=0; i').css( { "top":-(index*scroll)*slideh, "position":"relative","padding":"0","margin":"0"}).children().css( {"height":selfh} ); break; case "left": conbox.wrap('
').css( { "width":conboxsize*slidew,"left":-(index*scroll)*slidew,"position":"relative","overflow":"hidden","padding":"0","margin":"0"}).children().css( {"float":"left","width":selfw} ); break; case "leftloop": case "leftmarquee": cloneele(); conbox.wrap('
').css( { "width":(conboxsize+vis+clonenum)*slidew,"position":"relative","overflow":"hidden","padding":"0","margin":"0","left":-(clonenum+index*scroll)*slidew}).children().css( {"float":"left","width":selfw} ); break; case "toploop": case "topmarquee": cloneele(); conbox.wrap('
').css( { "height":(conboxsize+vis+clonenum)*slideh,"position":"relative","padding":"0","margin":"0","top":-(clonenum+index*scroll)*slideh}).children().css( {"height":selfh} ); break; } } //针对leftloop、toploop的滚动个数 var scrollnum=function(ind){ var _tempcs= ind*scroll; if( ind==navobjsize ){ _tempcs=conboxsize; }else if( ind==-1 && conboxsize%scroll!=0){ _tempcs=-conboxsize%scroll; } return _tempcs; } //切换加载 var doswitchload=function(objs){ var changeimg=function(t){ for ( var i= t; i<( vis+ t); i++ ){ objs.eq(i).find("images["+sload+"]").each(function(){ var _this = $(this); _this.attr("src",_this.attr(sload)).removeattr(sload); if( conbox.find(".clone")[0] ){ //如果存在.clone var chir = conbox.children(); for ( var j=0 ; j< chir.size() ; j++ ) { chir.eq(j).find("images["+sload+"]").each(function(){ if( $(this).attr(sload)==_this.attr("src") ) $(this).attr("src",$(this).attr(sload)).removeattr(sload) }) } } }) } } switch(effect) { case "fade": case "fold": case "top": case "left": case "slidedown": changeimg( index*scroll ); break; case "leftloop": case "toploop": changeimg( clonenum+scrollnum(_ind) ); break; case "leftmarquee":case "topmarquee": var curs = effect=="leftmarquee"? conbox.css("left").replace("px",""):conbox.css("top").replace("px",""); var slidet = effect=="leftmarquee"? slidew:slideh; var mnum=clonenum; if( curs%slidet!=0 ){ var curp = math.abs(curs/slidet^0); if( index==1 ){ mnum=clonenum+curp }else{ mnum=clonenum+curp-1 } } changeimg( mnum ); break; } }//doswitchload end //效果函数 var doplay=function(init){ // 当前页状态不触发效果 if( defaultplay && oldindex==index && !init && !ismarq ) return; //处理页码 if( ismarq ){ if ( index>= 1) { index=1; } else if( index<=0) { index = 0; } } else{ _ind=index; if ( index >= navobjsize) { index = 0; } else if( index < 0) { index = navobjsize-1; } } dostartfun(); //处理切换加载 if( sload!=null ){ doswitchload( conbox.children() ) } //处理targetcell if(tarobj[0]){ _tar = tarobj.eq(index); if( sload!=null ){ doswitchload( tarobj ) } if( effect=="slidedown" ){ tarobj.not(_tar).stop(true,true).slideup(delaytime); _tar.slidedown( delaytime,easing,function(){ if(!conbox[0]) doendfun() }); } else{ tarobj.not(_tar).stop(true,true).hide(); _tar.animate({opacity:"show"},delaytime,function(){ if(!conbox[0]) doendfun() }); } } if(conboxsize>=vis){ //当内容个数少于可视个数,不执行效果。 switch (effect) { case "fade":conbox.children().stop(true,true).eq(index).animate({opacity:"show"},delaytime,easing,function(){doendfun()}).siblings().hide(); break; case "fold":conbox.children().stop(true,true).eq(index).animate({opacity:"show"},delaytime,easing,function(){doendfun()}).siblings().animate({opacity:"hide"},delaytime,easing);break; case "top":conbox.stop(true,false).animate({"top":-index*scroll*slideh},delaytime,easing,function(){doendfun()});break; case "left":conbox.stop(true,false).animate({"left":-index*scroll*slidew},delaytime,easing,function(){doendfun()});break; case "leftloop": var __ind = _ind; conbox.stop(true,true).animate({"left":-(scrollnum(_ind)+clonenum)*slidew},delaytime,easing,function(){ if( __ind<=-1 ){ conbox.css("left",-(clonenum+(navobjsize-1)*scroll)*slidew); }else if( __ind>=navobjsize ){ conbox.css("left",-clonenum*slidew); } doendfun(); }); break;//leftloop end case "toploop": var __ind = _ind; conbox.stop(true,true).animate({"top":-(scrollnum(_ind)+clonenum)*slideh},delaytime,easing,function(){ if( __ind<=-1 ){ conbox.css("top",-(clonenum+(navobjsize-1)*scroll)*slideh); }else if( __ind>=navobjsize ){ conbox.css("top",-clonenum*slideh); } doendfun(); }); break;//toploop end case "leftmarquee": var templeft = conbox.css("left").replace("px",""); if(index==0 ){ conbox.animate({"left":++templeft},0,function(){ if( conbox.css("left").replace("px","")>= 0){ conbox.css("left",-conboxsize*slidew) } }); } else{ conbox.animate({"left":--templeft},0,function(){ if( conbox.css("left").replace("px","")<= -(conboxsize+clonenum)*slidew){ conbox.css("left",-clonenum*slidew) } }); }break;// leftmarquee end case "topmarquee": var temptop = conbox.css("top").replace("px",""); if(index==0 ){ conbox.animate({"top":++temptop},0,function(){ if( conbox.css("top").replace("px","")>= 0){ conbox.css("top",-conboxsize*slideh) } }); } else{ conbox.animate({"top":--temptop},0,function(){ if( conbox.css("top").replace("px","")<= -(conboxsize+clonenum)*slideh){ conbox.css("top",-clonenum*slideh) } }); }break;// topmarquee end }//switch end } navobj.removeclass(titon).eq(index).addclass(titon); oldindex=index; if( !pnloop ){ //pnloop控制前后按钮是否继续循环 nextbtn.removeclass("nextstop"); prevbtn.removeclass("prevstop"); if (index==0 ){ prevbtn.addclass("prevstop"); } if (index==navobjsize-1 ){ nextbtn.addclass("nextstop"); } } pagestate.html( ""+(index+1)+"/"+navobjsize); };// doplay end //初始化执行 if( defaultplay ){ doplay(true); } if (returndefault)//返回默认状态 { slider.hover(function(){ cleartimeout(rtnst) },function(){ rtnst = settimeout( function(){ index=defaultindex; if(defaultplay){ doplay(); } else{ if( effect=="slidedown" ){ _tar.slideup( delaytime, reseton ); } else{ _tar.animate({opacity:"hide"},delaytime,reseton ); } } oldindex=index; },300 ); }); } ///自动播放函数 var setinter = function(time){ inter=setinterval(function(){ opp?index--:index++; doplay() }, !!time?time:intertime); } var setmarinter = function(time){ inter = setinterval(doplay, !!time?time:intertime); } // 处理mouseoverstop var resetinter = function(){ if( !mouseoverstop ){clearinterval(inter); setinter() } } // 前后按钮触发 var nexttrigger = function(){ if ( pnloop || index!=navobjsize-1 ){ index++; doplay(); if(!ismarq)resetinter(); } } var prevtrigger = function(){ if ( pnloop || index!=0 ){ index--; doplay(); if(!ismarq)resetinter(); } } //处理playstate var playstatefun = function(){ clearinterval(inter); ismarq?setmarinter():setinter(); playstate.removeclass("pausestate") } var pausestatefun = function(){ clearinterval(inter);playstate.addclass("pausestate"); } //自动播放 if (autoplay) { if( ismarq ){ opp?index--:index++; setmarinter(); if(mouseoverstop) conbox.hover(pausestatefun,playstatefun); }else{ setinter(); if(mouseoverstop) slider.hover( pausestatefun,playstatefun ); } } else{ if( ismarq ){ opp?index--:index++; } playstate.addclass("pausestate"); } playstate.click(function(){ playstate.hasclass("pausestate")?playstatefun():pausestatefun() }); //titcell事件 if(opts.trigger=="mouseover"){ navobj.hover(function(){ var hoverind = navobj.index(this); mst = settimeout(function(){ index=hoverind; doplay(); resetinter(); },opts.triggertime); }, function(){ cleartimeout(mst) }); }else{ navobj.click(function(){ index=navobj.index(this); doplay(); resetinter(); }) } //前后按钮事件 if (ismarq){ nextbtn.mousedown(nexttrigger); prevbtn.mousedown(prevtrigger); //前后按钮长按10倍加速 if (pnloop) { var st; var mardown = function(){ st=settimeout(function(){ clearinterval(inter); setmarinter( intertime/10^0 ) },150) } var marup = function(){ cleartimeout(st); clearinterval(inter); setmarinter() } nextbtn.mousedown(mardown); nextbtn.mouseup(marup); prevbtn.mousedown(mardown); prevbtn.mouseup(marup); } //前后按钮mouseover事件 if( opts.trigger=="mouseover" ){ nextbtn.hover(nexttrigger,function(){}); prevbtn.hover(prevtrigger,function(){}); } }else{ nextbtn.click(nexttrigger); prevbtn.click(prevtrigger); } });//each end };//slide end })(jquery); jquery.easing['jswing'] = jquery.easing['swing']; jquery.extend( jquery.easing, { def: 'easeoutquad', swing: function (x, t, b, c, d) { return jquery.easing[jquery.easing.def](x, t, b, c, d); }, easeinquad: function (x, t, b, c, d) {return c*(t/=d)*t + b;}, easeoutquad: function (x, t, b, c, d) {return -c *(t/=d)*(t-2) + b}, easeinoutquad: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t + b;return -c/2 * ((--t)*(t-2) - 1) + b}, easeincubic: function (x, t, b, c, d) {return c*(t/=d)*t*t + b}, easeoutcubic: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t + 1) + b}, easeinoutcubic: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t + b;return c/2*((t-=2)*t*t + 2) + b}, easeinquart: function (x, t, b, c, d) {return c*(t/=d)*t*t*t + b}, easeoutquart: function (x, t, b, c, d) {return -c * ((t=t/d-1)*t*t*t - 1) + b}, easeinoutquart: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t*t + b;return -c/2 * ((t-=2)*t*t*t - 2) + b}, easeinquint: function (x, t, b, c, d) {return c*(t/=d)*t*t*t*t + b}, easeoutquint: function (x, t, b, c, d) {return c*((t=t/d-1)*t*t*t*t + 1) + b}, easeinoutquint: function (x, t, b, c, d) {if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;return c/2*((t-=2)*t*t*t*t + 2) + b}, easeinsine: function (x, t, b, c, d) {return -c * math.cos(t/d * (math.pi/2)) + c + b}, easeoutsine: function (x, t, b, c, d) {return c * math.sin(t/d * (math.pi/2)) + b}, easeinoutsine: function (x, t, b, c, d) {return -c/2 * (math.cos(math.pi*t/d) - 1) + b}, easeinexpo: function (x, t, b, c, d) {return (t==0) ? b : c * math.pow(2, 10 * (t/d - 1)) + b}, easeoutexpo: function (x, t, b, c, d) {return (t==d) ? b+c : c * (-math.pow(2, -10 * t/d) + 1) + b}, easeinoutexpo: function (x, t, b, c, d) {if (t==0) return b;if (t==d) return b+c;if ((t/=d/2) < 1) return c/2 * math.pow(2, 10 * (t - 1)) + b;return c/2 * (-math.pow(2, -10 * --t) + 2) + b}, easeincirc: function (x, t, b, c, d) {return -c * (math.sqrt(1 - (t/=d)*t) - 1) + b}, easeoutcirc: function (x, t, b, c, d) {return c * math.sqrt(1 - (t=t/d-1)*t) + b}, easeinoutcirc: function (x, t, b, c, d) {if ((t/=d/2) < 1) return -c/2 * (math.sqrt(1 - t*t) - 1) + b;return c/2 * (math.sqrt(1 - (t-=2)*t) + 1) + b}, easeinelastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;if (a < math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*math.pi) * math.asin (c/a);return -(a*math.pow(2,10*(t-=1)) * math.sin( (t*d-s)*(2*math.pi)/p )) + b}, easeoutelastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;if (a < math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*math.pi) * math.asin (c/a);return a*math.pow(2,-10*t) * math.sin( (t*d-s)*(2*math.pi)/p ) + c + b}, easeinoutelastic: function (x, t, b, c, d) {var s=1.70158;var p=0;var a=c;if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);if (a < math.abs(c)) { a=c; var s=p/4; } else var s = p/(2*math.pi) * math.asin (c/a);if (t < 1) return -.5*(a*math.pow(2,10*(t-=1)) * math.sin( (t*d-s)*(2*math.pi)/p )) + b;return a*math.pow(2,-10*(t-=1)) * math.sin( (t*d-s)*(2*math.pi)/p )*.5 + c + b}, easeinback: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*(t/=d)*t*((s+1)*t - s) + b}, easeoutback: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158;return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b}, easeinoutback: function (x, t, b, c, d, s) {if (s == undefined) s = 1.70158; if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b}, easeinbounce: function (x, t, b, c, d) {return c - jquery.easing.easeoutbounce (x, d-t, 0, c, d) + b}, easeoutbounce: function (x, t, b, c, d) {if ((t/=d) < (1/2.75)) { return c*(7.5625*t*t) + b;} else if (t < (2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;} else if (t < (2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;} else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;}}, easeinoutbounce: function (x, t, b, c, d) {if (t < d/2) return jquery.easing.easeinbounce (x, t*2, 0, c, d) * .5 + b;return jquery.easing.easeoutbounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;} }); ;window.modernizr=function(a,b,c){function x(a){j.csstext=a}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function a(a,b){return!!~(""+a).indexof(b)}function b(a,b){for(var d in a){var e=a[d];if(!a(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function c(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function d(a,b,c){var d=a.charat(0).touppercase()+a.slice(1),e=(a+" "+n.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?b(e,b):(e=(a+" "+o.join(d+" ")+d).split(" "),c(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentelement,h="modernizr",i=b.createelement(h),j=i.style,k,l={}.tostring,m="webkit moz o ms",n=m.split(" "),o=m.tolowercase().split(" "),p={},q={},r={},s=[],t=s.slice,u,v={}.hasownproperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},function.prototype.bind||(function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new typeerror;var d=t.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(t.call(arguments)));return object(g)===g?g:f}return c.apply(b,d.concat(t.call(arguments)))};return e}),p.csstransitions=function(){return d("transition")};for(var e in p)w(p,e)&&(u=e.tolowercase(),e[u]=p[e](),s.push((e[u]?"":"no-")+u));return e.addtest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addtest(d,a[d]);else{a=a.tolowercase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.classname+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),i=k=null,function(a,b){function k(a,b){var c=a.createelement("p"),d=a.getelementsbytagname("head")[0]||a.documentelement;return c.innerhtml="x",d.insertbefore(c.lastchild,d.firstchild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createelement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].clonenode():e.test(a)?g=(f.cache[a]=f.createelem(a)).clonenode():g=f.createelem(a),g.canhavechildren&&!d.test(a)?f.frag.appendchild(g):g}function o(a,c){a||(a=b);if(j)return a.createdocumentfragment();c=c||m(a);var d=c.frag.clonenode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childnodes.length==1||function(){b.createelement("a");var a=b.createdocumentfragment();return typeof a.clonenode=="undefined"||typeof a.createdocumentfragment=="undefined"||typeof a.createelement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivcss:c.shivcss!==!1,supportsunknownelements:j,shivmethods:c.shivmethods!==!1,type:"default",shivdocument:q,createelement:n,createdocumentfragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._domprefixes=o,e._cssomprefixes=n,e.testprop=function(a){return b([a])},e.testallprops=d,g.classname=g.classname.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+s.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?b.injectcss:b.injectjs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readystate)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removechild(l)},50);for(var d in y[c])y[c].hasownproperty(d)&&y[c][d].onload()}}var j=j||b.errortimeout,l=b.createelement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertbefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=b;return a.loader={load:j,i:0},a}var l=b.documentelement,m=a.settimeout,n=b.getelementsbytagname("script")[0],o={}.tostring,p=[],q=0,r="mozappearance"in l.style,s=r&&!!b.createrange().comparenode,t=s?l:n.parentnode,l=a.opera&&"[object opera]"==o.call(a.opera),l=!!b.attachevent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=array.isarray||function(a){return"[object array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},a,b;b=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origurl:c,prefixes:a},e,f,g;for(f=0;fh?(h/w):1),y=(coordinates.y-$el.offset().top-(h/2))*(h>w?(w/h):1),direction=math.round((((math.atan2(y,x)*(180/ math.pi) ) + 180 ) /90)+3)%4;return direction},_getstyle:function(direction){var fromstyle,tostyle,slidefromtop={left:'0px',top:'-100%'},slidefrombottom={left:'0px',top:'100%'},slidefromleft={left:'-100%',top:'0px'},slidefromright={left:'100%',top:'0px'},slidetop={top:'0px'},slideleft={left:'0px'};switch(direction){case 0:fromstyle=!this.options.inverse?slidefromtop:slidefrombottom;tostyle=slidetop;break;case 1:fromstyle=!this.options.inverse?slidefromright:slidefromleft;tostyle=slideleft;break;case 2:fromstyle=!this.options.inverse?slidefrombottom:slidefromtop;tostyle=slidetop;break;case 3:fromstyle=!this.options.inverse?slidefromleft:slidefromright;tostyle=slideleft;break};return{from:fromstyle,to:tostyle}},_applyanimation:function(el,stylecss,speed){$.fn.applystyle=this.support?$.fn.css:$.fn.animate;el.stop().applystyle(stylecss,$.extend(true,[],{duration:speed+'ms'}))}};var logerror=function(message){if(window.console){window.console.error(message)}};$.fn.hoverdir=function(options){var instance=$.data(this,'hoverdir');if(typeof options==='string'){var args=array.prototype.slice.call(arguments,1);this.each(function(){if(!instance){logerror("cannot call methods on hoverdir prior to initialization; "+"attempted to call method '"+options+"'");return}if(!$.isfunction(instance[options])||options.charat(0)==="_"){logerror("no such method '"+options+"' for hoverdir instance");return}instance[options].apply(instance,args)})}else{this.each(function(){if(instance){instance._init()}else{instance=$.data(this,'hoverdir',new $.hoverdir(options,this))}})}return instance}})(jquery,window); var pwidth=$(window).width();$(document).ready(function(){$(".ewm").hover(function(){$(this).find("img").slidedown()},function(){});if(pwidth<1024){$(".picmarquee-left").slide({maincell:".bd ul",autoplay:false,effect:"leftloop",vis:4,scroll:1,intertime:30})}else{$(".picmarquee-left").slide({maincell:".bd ul",autoplay:false,effect:"leftloop",vis:6,scroll:1,intertime:30})}$(".hn_column li").on("mouseenter",function(){$(this).find("h2").addclass("on").siblings(".text").stop().slidedown();$(this).siblings().find("h2").removeclass("on").siblings(".text").stop().slideup()}).eq(0).mouseenter();$(".jion_tab li").on("mouseenter",function(){$(this).addclass("on").siblings().removeclass("on");$(".jion_info dl").eq($(this).index()).show().siblings().hide()}).eq(1).mouseenter();$(' #da-thumbs > li ').each(function(){$(this).hoverdir()});var $nav=$(".nav");nav($nav);$nav.find("li").hover(function(){var left=$(this).position().left+20;$nav.find(".nav_icon").stop().animate({left:left},400)},function(){var left=$nav.find(".on").position().left+20;$nav.find(".nav_icon").stop().animate({left:left},300)});var banner=setinterval(play,3400);$("#list_pic li").hover(function(){var $pic=$("#pic");var size=$pic.find("li").size();var index=$(this).index();var width=$(window).width();var $obj=$pic.find("li").eq(index);$(this).addclass("on").siblings().removeclass("on");$pic.width(width*size).find("li").width(width);setposition($obj);$pic.animate({left:-width*index},600,function(){picscroll($obj)});clearinterval(banner)},function(){banner=setinterval(play,3400)});$("#fp-nav li").on("click",function(){var index=$(this).index();scroll_to(index)});var $obj3=$('.section3');var $obj4=$('.section4');var $obj5=$('.section5');var time=1200;$obj3.find('.succeed_title').css({position:"relative"}).animate({top:'-220px'},time,'easeoutexpo');$obj3.find('.container').css({position:"relative"}).animate({bottom:'-110%'},time,'easeoutexpo');$obj3.find('.text').css({position:"relative"}).animate({right:'-110%'},time,'easeoutexpo');$obj4.find('.home_title').css({position:"relative"}).animate({top:'-220px'},time,'easeoutexpo');$obj4.find('.hn_column').css({position:"relative"}).animate({right:'-110%'},time,'easeoutexpo');$obj4.find('.hn_main').css({position:"relative"}).animate({left:'-110%'},time,'easeoutexpo');$obj5.find('.partner').css({position:"relative"}).animate({bottom:'-110%'},time,'easeoutexpo');$obj5.find('.footer').css({position:"relative"}).animate({bottom:'-120%'},time,'easeoutexpo');$(".serve_column dt").each(function(){var that=this;$(that).bind({mouseenter:function(){item4timer=settimeout(function(){width=$(that).width()*1.2;height=$(that).height()*1.2;$(that).find('img').animate({'width':width,'height':height,'top':-20,'left':-27},500)},200)},mouseleave:function(){cleartimeout(item4timer);$(that).find('img').animate({'width':$(that).width(),'height':$(that).height(),'top':'0','left':'0'},500)}})})});$(window).scroll(function(){var boxelemets=$(".section");var docviewtop=$(window).scrolltop();var docviewbottom=docviewtop+$(window).height();$.each(boxelemets,function(){var otop=$(this).offset().top;if(otop=2500){cur_index=4}else if(docviewtop>=1800){cur_index=3}else if(docviewtop>=1200){cur_index=2}else if(docviewtop>=550){cur_index=1}$("#fp-nav li a").eq(cur_index).addclass("active");$("#fp-nav li").eq(cur_index).siblings().find("a").removeclass("active")});function scroll_to(i_tab){$("#fp-nav li a").eq(i_tab).addclass("active");$("#fp-nav li").eq(i_tab).siblings().find("a").removeclass("active");var top=$(".section").eq(i_tab).offset().top;$('html,body').animate({scrolltop:top},500);var $obj2=$('.section2');var $obj3=$('.section3');var $obj4=$('.section4');var $obj5=$('.section5');var time=1200;var delay=0;if(i_tab==1){$obj2.find('.home_title').css({position:"relative"}).delay(delay).animate({top:'0'},1500,'easeoutexpo');$obj2.find('.serve_column').css({position:"relative"}).delay(delay).animate({left:'0'},1500,'easeoutexpo')}if(i_tab==2){$obj3.find('.succeed_title').css({position:"relative"}).delay(delay).animate({top:'0'},time,'easeoutexpo');$obj3.find('.container').css({position:"relative"}).delay(delay).animate({bottom:'0'},time,'easeoutexpo');$obj3.find('.text').css({position:"relative"}).delay(delay).animate({right:'0'},1500,'easeoutexpo')}if(i_tab==3){$obj4.find('.home_title').css({position:"relative"}).delay(delay).animate({top:'0'},time,'easeoutexpo');$obj4.find('.hn_column').css({position:"relative"}).delay(delay).animate({right:'0'},time,'easeoutexpo');$obj4.find('.hn_main').css({position:"relative"}).delay(delay).animate({left:'0'},time,'easeoutexpo')}if(i_tab==4){$obj5.find('.partner').css({position:"relative"}).delay(delay).animate({bottom:'0'},time,'easeoutexpo');$obj5.find('.footer').css({position:"relative"}).delay(delay).animate({bottom:'0'},time,'easeoutexpo')}}function play(){var $pic=$("#pic");var $picli=$pic.find("li");var size=$picli.size();var $list=$("#list_pic");var width=$(window).width();$picli.width(width);var index=$list.find(".on").index();$pic.css({width:width*(size+1)});if(index<(size-1)){$list.find("li").eq(index+1).addclass("on").siblings().removeclass("on");setposition($picli.eq(index+1));$pic.animate({left:-width*(index+1)},600,function(){picscroll($picli.eq(index+1))})}else if(index==(size-1)){$list.find("li").eq(0).addclass("on").siblings().removeclass("on");setposition($picli.eq(0));$pic.animate({left:0},600,function(){picscroll($picli.eq(0))})}}function setposition($obj){var $title=$obj.find(".b_title");var $text=$obj.find(".b_text");var $info=$obj.find(".b_info");var $first=$text.find("img:first-child");var $last=$text.find("img:last-child");var width=$(window).width();var wtitle=$title.find("img").width();var wtext=$text.find("img:eq(1)").width();var winfo=$info.find("img").width();$title.find("img").css({position:"relative",left:-width/ 2 - wtitle /2});$info.find("img").css({position:"relative",left:width/ 2 + winfo /2});$first.css({position:"relative",left:-width/ 2 - wtext /2});$last.css({position:"relative",left:width/ 2 + wtext /2});$text.find("img:eq(1)").css({opacity:0})}function picscroll($obj){var $title=$obj.find(".b_title");var $text=$obj.find(".b_text");var $info=$obj.find(".b_info");var $first=$text.find("img:first-child");var $last=$text.find("img:last-child");$title.find("img").animate({left:0},1000);$info.find("img").animate({left:0},1000);$text.find("img:eq(1)").animate({opacity:1},800,function(){$first.animate({left:0},400);$last.animate({left:0},400)})}function nav($obj){var left=$obj.find(".on").position().left+20;var width=$obj.find(".on").width();$obj.find(".nav_icon").css({left:left,width:width})}