$(function () { headh() $(window).resize(function(){ headh() }); sizew() window.onresize = function(){ sizew() }; csx(); $(window).resize(function(){ csx(); }); $('#product').slide({ titcell: '.hd ul', maincell: '.bd ul', autoplay: false, autopage: true, delaytime: 500, intertime: 5000, effect: 'leftloop', trigger: "click", vis: 4 }); $('#solute').slide({ titcell: '.hd ul', maincell: '.bd ul', autoplay: false, autopage: true, delaytime: 500, intertime: 5000, effect: 'leftloop', trigger: "click", vis: 4}); $("#recompro").slide({ titcell: '.hd ul', maincell: '.bd ul', autoplay: true, autopage: true, delaytime: 500, intertime: 5000, effect: 'leftloop', trigger: "click", vis: 4}); $("#caserecom").slide({ titcell: '.hd ul', maincell: '.bd ul', autoplay: true, autopage: true, delaytime: 500, intertime: 5000, effect: 'leftloop', trigger: "click", vis: 3}); $(".goback").on("click", function () { history.go(-1); }); function csx(){ var win = $(window).width(); if (win > 1024) { $('.search-box').hover(function(){ $('.search-box').addclass("on"); },function(){ $('.search-box').removeclass("on"); }) } } $('.bds_weixin').on('hover',function(){ $('.weixin-box').fadein(); }) $('.weixin-box .close').on('click',function(){ $('.weixin-box').fadeout(); }) if($("#wrap").length>0){ $('.search-box').addclass("two"); } $('.search-box-btn').click(function(){ if ($(this).hasclass('on')) { $('.search-box').removeclass('on'); $(this).removeclass('on'); $('.search-box .submit').hide() }else{ $('.search-box').addclass('on'); $(this).addclass('on'); settimeout(function(){ $('.search-box .submit').fadein() },300) } }) $('.i-ban-link li').each(function(){ var index = $(this).index(); $(this).addclass('li' + index); }); $('#menu').addclass("one"); $('.bottom_copy').addclass("one"); settimeout(function(){ $('.i-ban-link li').each(function(){ var index = $(this).index(); $(this).delay(index * 200).animate({top:0,opacity:1},400); }) },800) if ($(".wrap").length > 0) { var _height = $(window).height(); $('.nav-box .nav-list-box').css("height",_height); $('.nav-box .bg').css("height",_height); } if ($("#insolutions").length > 0) { var _height = $(window).height(); $('.nav-box .nav-list-box').css("height", _height); $('.nav-box .bg').css("height", _height); } if ($("#productcenter").length > 0) { var _height = $(window).height(); $('.nav-box .nav-list-box').css("height", _height); $('.nav-box .bg').css("height", _height); } $('#header_main .tit').on('click',function(){ console.log(_height); if ($(this).hasclass("on")) { $(this).removeclass("on"); $('#header_main.the').removeclass("on"); $('.nav-box').hide(); $('.nav-box .nav-list-box').slideup(300,function(){ $('.nav-box .bg').fadeout(); }); }else{ $(this).addclass("on"); $('#header_main').addclass("white"); $('#header_main').removeclass('one'); $('#header_main').removeclass('two'); $('#header_main.the').addclass("on"); $('.nav-box').show(); $('.nav-box .nav-list-box').slidedown(); $('.nav-box .bg').fadein(); } }) $('.nav-box .bg').on('click',function(){ $('#header_main .tit').removeclass("on"); $('.nav-box').hide(); $('.nav-box .nav-list-box').slideup(300,function(){ $('.nav-box .bg').fadeout(); }); }) $("#sub-nav .sli").click(function () { $(this).addclass("hover"); $(this).addclass("hover").siblings().removeclass("hover"); if ($(this).find(".sub-box-list").hasclass("hidden")) { $(this).find(".sub-box-list").removeclass("hidden").parents(".sli").siblings().find(".sub-box-list").addclass("hidden"); } else { $(this).removeclass("hover"); $(this).find(".sub-box-list").addclass("hidden"); } }); //招贤纳士 if ($(".postlist").length) { $(".postlist .item").click(function () { $(this).addclass("hover").siblings().removeclass("hover"); if ($(this).find(".bottom").hasclass("hidein")) { $(this).find(".bottom").removeclass("hidein").parents(".item").siblings().find(".bottom").addclass("hidein"); } else { $(this).removeclass("hover"); $(this).find(".bottom").addclass("hidein"); }; }); }; $('#proinfo .top h3').click(function(){ var index = $(this).index(); $(this).addclass("hover").siblings().removeclass("hover"); $(this).parents("#proinfo").find(".bottom .itembox").eq(index).show().siblings().hide(); }); function headh(){ var winh = $(window).height(); var winw = $(window).width(); var htmlh = $('html,body').height(); var heg = $('#header_main').height(); $('#header_main .logo,#header_main .nav-list').css('line-height',heg+'px'); $('#header_main .bdsharebuttonbox,header .nav-list').css('height',heg+'px'); $('.nav-box').css({ 'height':htmlh - heg, 'top':heg, }) } function sizew(){ var ww = $('.i-wrap5 .right').width(); if ($(window).width() > 1024) { var hei = $(window).height(); $('#header_main').addclass('flex'); $('.i-wrap5 .right a').css('height',hei*0.96); }else{ $('#header_main').removeclass('flex'); $('#header_main').removeclass("one"); } $('.i-wrap5 .right li').eq(2).addclass('on'); if ($(window).width() > 580) { $('.i-wrap5 .right li').width(ww /3); var liw = $('.i-wrap5 .right li').width(); }else{ $('.i-wrap5 .right li').width(ww - 2); var liw = $('.i-wrap5 .right li').width() + 2; } var sc = 0; var size = $('.i-wrap5 .right li').size(); if ($(window).width() < 580) { touch.on('.i-wrap5 .right', 'swipeleft swiperight', function(ev){ console.log(sc); if (ev.type == 'swipeleft') { if (sc == size - 1) { return false; }else{ sc ++; sizes(); $('.i-wrap5 .right li').removeclass('on'); } }else{ if (sc == 0) { return false; }else{ sc --; sizes(); $('.i-wrap5 .right li').removeclass('on'); } } }); }else{ if ($(window).width() < 1025) { touch.on('.i-wrap5 .right', 'swipeleft swiperight', function(ev){ if (ev.type == 'swipeleft') { if (sc == size - 3) { return false; }else{ sc ++; sizes(); } }else{ if (sc == 0) { return false; }else{ sc --; sizes(); } } }); } $('.i-wrap5 .btns a.prev').on('click',function(){ if (sc == 0) { return false; }else{ sc --; sizes(); } }) $('.i-wrap5 .btns a.next').on('click',function(){ if (sc == size - 3) { return false; }else{ sc ++; sizes(); } }) } var win = $(window).width(); if ($('.i-wrap5').length>0) { if (win < 1025) { $(window).scroll(function(){ var scro = $(window).scrolltop(); var wrap4 = $('.i-wrap5').offset().top - ($(window).height()/2); if(scro > wrap4){ $('.i-wrap5 .left').stop().animate({left:0,opacity:1},500); $('.i-wrap5 .right li').each(function(){ var index = $(this).index(); $(this).delay(index * 100).animate({left:0,opacity:1},300); }) } }) } } function sizes(){ $('.i-wrap5 .right ul').stop().animate({'margin-left':-(sc * liw)},300); $('.i-wrap5 .right li').eq(sc + 2).addclass('on').siblings('li').removeclass('on'); } nav(); function nav() { $("#nav li.suli").hover(function () { $(this).children('.sub-box').stop(true, true).slidedown(); }, function () { $(this).children('.sub-box').stop(true, true).slideup(); }); } } });