// 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--------