// javascript document //--------header start-------- $(function () { $(window).load(function(){ positioncont(); $(window).resize(function () { positioncont(); }); }); function positioncont(){ var windowwid = $(window).width(); if (windowwid > 992) {//pc $(".klynav").show(); $(".klynavbg").hide(); $(".klyinpro-one img").attr("src",$(".inpro-one img").attr("pcimg")); $(".klysearch-btn").unbind("click").bind("click", function () { $(".klysearch-wrap").stop().fadetoggle(300); }); $(window).scroll(function () { var scrolltop = $(this).scrolltop(); if (scrolltop > 150) { $(".commonposition").show(); } else { $(".commonposition").hide(); } }); $(".commonposition a").hover(function () { $(this).find("span").show(300); }, function () { $(this).find("span").hide(300); }); $(".hometop").on("click", function () { $("html,body").animate({ "scrolltop": 0 }, 200); }); }else{//mobile $(".klynav-btn").unbind().bind("click", function () { $(this).toggleclass("cur"); $(".klynav").slidetoggle(300); $(".klynavbg").fadetoggle(300); $(".klysearch-wrap").fadeout(300); }); $(".klysearch-btn").unbind("click").bind("click", function () { if ($(".klysearch-wrap").is(":hidden")) { $(".klysearch-wrap").fadein(300); $(".klynav").slideup(300); $(".klynavbg").fadeout(300); $(".klynav-btn").removeclass("cur"); }else{ $(".klysearch-wrap").fadeout(300); }; }); var swiper = new swiper('.goodixphonescroll', { pagination: '', nextbutton: '.rightgoodix', prevbutton: '.leftgoodix', paginationclickable: true, preventclicks: false, autoplaydisableoninteraction: false, grabcursor: false, parallax: true }); $(".inpro-one img").attr("src",$(".inpro-one img").attr("mobimg")); }; }; //-------- 员工风采 -------- $(".staffstyle-list dl dd").on("mouseenter", function () { $(this).find(".zfloatgoodix").stop(true, true).fadein(300); }); $(".staffstyle-list dl dd").on("mouseleave", function () { $(this).find(".zfloatgoodix").stop(true, true).fadeout(300); }); // banner //-------- banner -------- if ($(".indexbanner").length > 0) { var myswiper = new swiper('.indexbanner', { effect: 'slide', loop: true, autoplay: 5000, speed: 1000, pagination: '.indexbannerbtn p', paginationclickable: true, preventclicks: false, autoplaydisableoninteraction: false, grabcursor: false, parallax: true, ontransitionend: function (swiper) { $(".indexbanner ul li").eq(swiper.activeindex).addclass("active").siblings().removeclass("active"); } }); }; windowwidth(); $(window).resize(function () { windowwidth(); }); function windowwidth() { var overflowwid = $("body").css("overflow", "hidden").width(); var windowwid = $("body").removeattr("style").width(); var scrollwid = overflowwid - windowwid; if (windowwid + scrollwid > 1024) { $(".indexbanner li").each(function () { var thisindex = $(this); var datecolor = thisindex.find(".bannertextcont").attr("data-color"); var listattr = thisindex.find(".bannertextcont").attr("style"); //thisindex.find(".bannertextcont").attr("style", datecolor); }); } else { $(".indexbanner li").each(function () { var thisindex = $(this); var listattr = thisindex.find(".bannertextcont").attr("style"); //thisindex.find(".bannertextcont").attr("style",""); }); }; } }); //--------header end--------