/* @update: 2015-4-15 19:22:22 */ function scrollbar(t){this.leftbtn=t.leftbtn||null,this.rightbtn=t.rightbtn||null,this.scrollbody=t.scrollbody,this.holder=t.holder,this.indexbtn=t.indexbtn||null,this.indexbtnclass=t.indexbtnclass||null,this._autoplay=t._autoplay||!1,this.scrolltype=t.scrolltype||"opacity",this.css3animate=t.css3animate||!1,this._init()}function getcss3animation(){var t=document.createelement("div"),e=!1;return"oninput"in t&&["","ms","webkit"].foreach(function(n){var i=n+(n?"a":"a")+"nimation";i in t.style&&(e=!0)}),e}$(document).ready(function(){function t(){var t=$("#homebanner");if(!t[0])return!1;var e=$("#pre"),n=$("#nex"),i=t.find(".indexbtn"),a=t.find(".pic-layer"),s=a.find("li"),r=getcss3animation();s.each(function(t){var e=$(this),n=e.attr("data-bkg");if(n&&!r){var i=new image;i.src=n,i.index=t,i.onload=function(){s.eq(this.index).css("backgroundimage","url("+n+")")}}}),new scrollbar({leftbtn:e,rightbtn:n,scrollbody:t,holder:s,indexbtn:i,indexbtnclass:"current",_autoplay:!0,css3animate:r})}function e(){var t=$("#homebanner2");if(!t[0])return!1;var e=null,n=null,i=t.find(".indexbtn2"),a=t.find(".pic-layer2"),s=a.find(".q-box"),r=getcss3animation();s.each(function(t){var e=$(this),n=e.attr("data-bkg");if(n&&!r){var i=new image;i.src=n,i.index=t,i.onload=function(){s.eq(this.index).css("backgroundimage","url("+n+")")}}}),new scrollbar({leftbtn:e,rightbtn:n,scrollbody:t,holder:s,indexbtn:i,indexbtnclass:"current",_autoplay:!0,css3animate:r})}function n(){var t=$("#homebanner4");if(!t[0])return!1;var e=null,n=null,i=t.find(".indexbtn4"),a=t.find(".pic-layer4"),s=a.find(".goodlife-ul"),r=getcss3animation();s.each(function(t){var e=$(this),n=e.attr("data-bkg");if(n&&!r){var i=new image;i.src=n,i.index=t,i.onload=function(){s.eq(this.index).css("backgroundimage","url("+n+")")}}}),new scrollbar({leftbtn:e,rightbtn:n,scrollbody:t,holder:s,indexbtn:i,indexbtnclass:"current",_autoplay:!0,css3animate:r})}function i(){var t=$("#homebanner5");if(!t[0])return!1;var e=null,n=null,i=t.find(".indexbtn5"),a=t.find(".pic-layer5"),s=a.find(".recommend"),r=getcss3animation();s.each(function(t){var e=$(this),n=e.attr("data-bkg");if(n&&!r){var i=new image;i.src=n,i.index=t,i.onload=function(){s.eq(this.index).css("backgroundimage","url("+n+")")}}}),new scrollbar({leftbtn:e,rightbtn:n,scrollbody:t,holder:s,indexbtn:i,indexbtnclass:"current",_autoplay:!0,css3animate:r})}function a(){var t=$("#on-order").find("li");$.ajax({url:"http://baitiao.jd.com/activity/querybtorder",type:"get",datatype:"json",success:function(e){var n=e,i=e.length,a=null;if(i>=12)for(var s=0;12>s;s++){var r="",o="";o="null"==n[s].userimgurl?"http://static.360buyimg.com/finance/assets/common/1.3.0/css/i/user-logo.jpg":n[s].userimgurl,a=math.round(n[s].price/12*1.06*100)/100,r+='

'+n[s].pin+'\u521a\u6253\u4e86\u4e2a\u767d\u6761

\uffe5'+a+"

 x 12\u671f
",t.eq(s).append(r)}else for(var s=0;i>s;s++){var r="",o="";alert(),o="null"==n[s].userimgurl?"http://static.360buyimg.com/finance/assets/common/1.3.0/css/i/user-logo.jpg":n[s].userimgurl,a=math.round(n[s].price/12*1.06*100)/100,r+='

'+n[s].pin+'\u521a\u6253\u4e86\u4e2a\u767d\u6761

\uffe5'+a+"

 x 12\u671f
",t.eq(s).append(r)}}})}$(".phone").parent().hover(function(){$(".wechat-code2").stop().animate({opacity:"1"},500),$(".wechat-code3").stop().animate({opacity:"0"},500),$(".we-2").addclass("animated rotateindownleft"),$(".we-1").removeclass("animated rotateindownleft"),$(".we-3").removeclass("animated rotateindownleft")}),$(".sina").parent().hover(function(){$(".wechat-code3").stop().animate({opacity:"1"},500),$(".we-3").addclass("animated rotateindownleft"),$(".we-1").removeclass("animated rotateindownleft"),$(".we-2").removeclass("animated rotateindownleft")}),$(".default").hover(function(){$(".wechat-code2").stop().animate({opacity:"0"},500),$(".wechat-code3").stop().animate({opacity:"0"},500),$(".we-1").addclass("animated rotateindownleft"),$(".we-2").removeclass("animated rotateindownleft"),$(".we-3").removeclass("animated rotateindownleft")}),$(".oul li").hover(function(){$(".oul li").stop().animate({opacity:"0.3"},500),$(this).stop().animate({opacity:"1"},500),$(".dot").removeclass("dot-on"),$(".dot").eq($(this).index()).addclass("dot-on")},function(){$(".oul li").stop().animate({opacity:"1"},500)}),$(".newp-span").click(function(){$(".new-plus").animate({height:"0"},500),$(".header-con").animate({height:"235"},500),$(".newp-span").hide()}),t(),e(),n(),i(),a()}),scrollbar.prototype={_init:function(){this.currentindex=0,this.targetindex=0,this.itemnum=this.holder.length,this.scrollspeed=1e3,this.css3animate&&this.checkpicloaded(this.holder.eq(this.currentindex).show()),this._autoplay&&(this.autoplaylag=11e3,this.autoplay()),this.bindevent()},bindevent:function(){var t=this;return this.leftbtn&&this.leftbtn.bind("click",function(){t.targetindex--,t.targetindex<0&&(t.targetindex=t.itemnum-1),t.scroll("left")}),this.rightbtn&&this.rightbtn.bind("click",function(){t.targetindex++,t.targetindex>=t.itemnum&&(t.targetindex=0),t.scroll("right")}),this.indexbtn&&this.indexbtn.bind("click",function(){$(this).index()>t.targetindex?(t.targetindex=$(this).index(),t.scroll("right")):$(this).index()=t.itemnum&&(t.targetindex=0),t.scroll("right")},t.autoplaylag)},checkpicloaded:function(t){for(var e=this,n=t.children("div"),i=n.length,a=0,s=0;i>s;s++){var r=new image;r.src=n.eq(s).attr("data-bkg"),r.onload=function(){a++,a==i&&(t.css("backgroundimage","none"),e.animatelayer(t))}}},resetlayer:function(t){var e=t.children("div");e.each(function(){$(this).removeclass($(this).attr("data-type")),$(this).attr("data-isbg")||$(this).hide()})},animatelayer:function(t){var e=this,n=t.children("div"),i=0,a=[],s=[];n.each(function(){a.push($(this)),$(this).removeclass($(this).attr("data-type"));var t=$(this).attr("data-delay");s[t-1]?s[t-1].push($(this)):s[t-1]=[$(this)]}),clearinterval(this.animatetimer),this.animatetimer=setinterval(function(){if(s[i])for(var t=0;ts.length&&cleartimeout(e.animatetimer),i++},100)}};