$(document).ready(function () { //头部滚动效果 $(window).scroll(function (){ var scTop = $(window).scrollTop(); if (scTop>0){ $('#header').addClass('scroll'); // $('#header .default').addClass('hide'); // $('#header .notshow').removeClass('hide'); changeLogo('light'); }else { $('#header').removeClass('scroll'); // $('#header .default').removeClass('hide'); // $('#header .notshow').addClass('hide'); changeLogo('dark'); } }); $('#header .menu-btn').click(function (){ $(this).toggleClass('show'); var menu = $('.fix-menu') menu.toggleClass('show'); if(menu.hasClass('show')){ changeLogo('light'); $('.nav-list').hide(); $('html,body').css('overflow-y','hidden'); }else { if($('#header').hasClass('scroll')){ changeLogo('dark'); } // changeLogo('dark'); $('.nav-list').show(); $('html,body').css('overflow-y','auto'); } }); indexBusinWidth(); var wi = $(window).width(); if(wi<=750){ //手机版底部导航 $("#footer .top .nav-wrap .item .title").click(function(){ $(this).next().slideToggle(); $(this).parent().siblings().children("#footer .top .nav-wrap .item .list").slideUp(); $(this).toggleClass("on"); $(this).parent().siblings().find(".title").removeClass("on"); }); //底部招商中心人力资源点击 $('#index .index-wrap .item6 .nav-list .item').click(function(){ var bg = $(this).attr('bg'); $('#index .index-wrap .join-wrap').css('background-image','url('+bg+')'); $(this).addClass('on').siblings('.item').addClass('under'); }); } }); $(window).resize(function(){ indexBusinWidth(); }); // 根据屏幕宽度计算首页业务领域的左侧宽度 function indexBusinWidth(){ var innerw = $('.cw1561').width(); var w = $(window).width(); // console.log(w,innerw); var scale = (((w - innerw) / 2) / w) * 100; $('#index .index-wrap .item3 .txt-cont').css({'padding-left':scale+'%'}); } function changeLogo(status){ switch (status){ case 'light': $('#header .default').addClass('hide'); $('#header .notshow').removeClass('hide'); break; case 'dark': $('#header .default').removeClass('hide'); $('#header .notshow').addClass('hide'); break; } } var indexScroll = { headerChange:function (s){ var pageIndex = s.activeIndex; if(pageIndex == 4){ $('#header').addClass('index'); changeLogo('light'); $('.contact-info .info-box').addClass('white'); $('.idx-copyright').addClass('white'); $('.contact-box').addClass('white'); $('.idx-pagin').addClass('white'); $('.fix-line').addClass('white'); }else{ $('#header').removeClass('index'); changeLogo('dark'); $('.contact-info .info-box').removeClass('white'); $('.idx-copyright').removeClass('white'); $('.contact-box').removeClass('white'); $('.idx-pagin').removeClass('white'); $('.fix-line').removeClass('white'); } if(pageIndex == 1 || pageIndex == 2 || pageIndex == 4){ changeLogo('light'); }else{ changeLogo('dark'); } if(pageIndex == 5){ $('#header').hide(); // 底部招商中心人力资源的hover效果 $('#index .index-wrap .item6 .nav-list .item').hover(function(){ var bg = $(this).attr('bg'); $('#index .index-wrap .join-wrap').css({'background-image':'url('+bg+')','opacity':'0'}); setTimeout(function () { $('#index .index-wrap .join-wrap').css({'opacity':'1'}); },400); $(this).addClass('on').siblings('.item').addClass('under'); },function(){ $('#index .index-wrap .join-wrap').css({'opacity':'0'}); $('#index .index-wrap .join-wrap').css('background-image','url(none)'); setTimeout(function () { $('#index .index-wrap .join-wrap').css({'opacity':'1'}); },400) $(this).removeClass('on').siblings('.item').removeClass('under'); }) }else{ $('#header').show(); } }, pagin:function (s) { // console.log($('.idx-pagin>*')); var page = s.slides; for (var i=0;i*').eq(i).append('
'+name+'
'); } }, slideIn:function (s){ var curIndex = s.activeIndex; //背景缩放 // $('#index .index-wrap .wrap-item').eq(curIndex).animate({"background-size":"125%"}, 7000); // $('#index .index-wrap .wrap-item').eq(curIndex).siblings('.wrap-item').stop().css({"background-size":"100% 100%"}); $('#index .index-wrap .wrap-item').eq(curIndex).addClass('scale-b'); $('#index .index-wrap .wrap-item').eq(curIndex).siblings('.wrap-item').removeClass('scale-b'); }, slideOut:function (s){ var curIndex = s.activeIndex; }, bannerEffect:function (obj){ // Banner背景缩放 $('.index-swiper1.pc .swiper-slide .a').eq(obj.activeIndex).addClass('scale-b'); $('.index-swiper1.pc .swiper-slide .a').eq(obj.activeIndex).siblings('.a').removeClass('scale-b'); // $('.index-swiper1.pc .swiper-slide .a').eq(obj.activeIndex).animate({"background-size":"125%"}, 7000); // $('.index-swiper1.pc .swiper-slide .a').eq(obj.activeIndex).siblings('.a').stop().css({"background-size":"100% 100%"}); }, }