/*banner*/ var banner=new change(); banner.position=function(){ change().position.call(this); if(this.data["position_style"]=="banner"){ var h=$(this.data["element"]+":eq("+this.data["index"]+")").height(); $(this.data["element_move"]).css({"height":h+"px"}); $(this.data["element"]).removeclass("in").css({"left":-this.data["position_width"]+"px"}); $(this.data["element"]+":eq("+this.data["index"]+")").addclass("in").css({"left":"0px"}); } } banner.todo=function(data){ var bool=change().todo.call(this,data); if(!bool)return false; if(this.data["position_style"]=="banner"){ var direc=-1; if(data["direc"]=="-")direc=1; var h=$(this.data["element"]+":eq("+this.data["index"]+")").height(); $(this.data["element_move"]).css({"height":h+"px"}); $(this.data["element"]+":eq("+this.data["lastindex"]+")").stop(false,true).removeclass("in").animate({"left":direc*this.data["position_width"]+"px"},500); $(this.data["element"]+":eq("+this.data["index"]+")").stop(false,true).addclass("in").css({"left":-direc*this.data["position_width"]+"px"}).animate({"left":"0px"},500,function(){banner.data["todo_bool"]=false;}); } } banner.init({ "parent_move_element":".banner", "element":".banner .content", "position_style":"banner", "autoplay":true, "autoplay_time":6000, "btn":'
', "btn_function":"banner", "btn_parent":".banner .banner-nav" }); $(function(){ //logo的效果 var winh = $('.header .nav li .title').height() $(window).scroll(function(e) { var wintop = $(window).scrolltop() if( wintop > winh ){ $('.header .logo').css({'width':'100px'}) //$('.notice').fadein(500) }else{ //$('.notice').fadeout(500); $('.header .logo').css({'width':'178px'}) }; }); // 导航 var winw = $(window).width(); if( winw >= 1040){ // 大分区的导航栏的效果 $('.header .nav li').hover(function() { $('.header .nav li .child').stop().hide(); $(this).find(".child").stop().show(); },function(){ $(this).find(".child").stop().hide(); }); // 结束 // 遍历所有 增加样式 $('.header .nav li .child').each(function(el) { $(this).find('.imgs00').eq(0).stop().show(); $(this).find('.h').hover(function() { $('.header .nav li .child').find('.h').removeclass('s'); $(this).addclass('s'); var mmm = $(this).index(); $('.header .nav li .child').each(function(index, el) { $(this).find('.imgs00').eq(mmm).stop().show().siblings().hide(); }); }); // $(this).mouseleave(function(event) { // $(this).hide(); // }); }); } // 中英文切换 function s(e){ $(e).children().stop().slidetoggle(400) }; $('.header .customer .child').click(function(event) { var i = $(this); s(i) }); // 手机端导航的切换 $('.header .mobile').click(function(event) { $('.mobile-nav').toggleclass('show'); $('body').toggleclass('oh'); }); $('.header .mobile-nav dl').click(function(event) { $('.header .mobile-nav dl').not($(this)).removeclass('l') $(this).toggleclass('l'); // $(".header .mobile-nav").not($(this)).find('dl').removeclass('l'); }); $('.header .mobile-nav dl .mm').hover(function() { $('.header .mobile-nav dl .mm .list').hide(); $(this).find('.list').stop().show(); }); $('.header .mobile-nav dl .mm').mouseleave(function(event) { $(this).find('.list').stop().hide(); }); // 结束 var winwidth = $(window).width()+17; if(winwidth<656) { $('.header .mobile').click(function(event) { $('body,html').toggleclass('oh'); $('.header .scroll_box').stop().fadetoggle(); }); } }) // 回到顶部 $(function(){ $(".back-top").click(function(){ $("html,body").stop().animate({scrolltop: 0}, 800); }); })