aos.init({ easing: "ease", duration: 1000, disable: "mobile", }); $(function () { var _w = $("body").width(); $(".header .think").click(function () { $(this).find(".sub").slidetoggle() }); if ($(window).scrolltop() > 70) { $(".header").addclass("active"); } else { $(".header").removeclass("active"); } // pc头部menu $(window).scroll(function () { if ($(this).scrolltop() > 70) { $(".header").addclass("active"); } else { $(".header").removeclass("active"); } }); $(".gotop").click(function () { $("body,html").animate( { scrolltop: 0, }, 500 ); return false; }); $(".proul li").hover(function () { $(this).addclass("on") $(this).siblings().removeclass("on") }) $(".header .search").click(function () { $(".searchbox").animate({ top: "0" }, 300); }) $(".searchbox .close").click(function () { $(".searchbox").animate({ top: "-100%" }, 300); }); $(".header .innav > ul > li").hover(function () { $(this).find(".dropdown").stop().slidedown(); $(this).siblings().find(".dropdown").stop().slideup(); }, function () { $(this).find(".dropdown").stop().slideup(); }); $(".header .dz").click(function () { $(".ordercon").stop().slidedown(); }); $(".header .ordercon .r .con img").click(function () { $(".ordercon").stop().slideup(); }); $(".banner-box .banner-item").attr("data-swiper-parallax-x", _w); // 首页轮播banner var banner = new swiper(".banner", { parallax: true, loop: true, speed: 1200, autoplay: { delay: 10000, //1秒切换一次 }, navigation: { nextel: ".bannernext", prevel: ".bannerprev", }, pagination: { el: ".homepagination", clickable: true, renderbullet: function (index, classname) { return ''; }, }, on: { slidechange: function () { console.log(this.activeindex); if (this.activeindex == 5 || this.activeindex == 1) { $("#video").trigger("play"); } else { $("#video").trigger("pause"); } }, }, }); //首页新闻 var newswiper1 = new swiper(".newswiper1", { slidesperview: 4, spacebetween: 70, autoplay: true, navigation: { nextel: ".newsnext1", prevel: ".newsprev1", }, pagination: { el: ".newswiperpagination", type: "progressbar", progressbarfillclass: "my-pagination-progressbar-fill", }, breakpoints: { 320: { slidesperview: 2, spacebetween: 10, }, 767: { slidesperview: 2, spacebetween: 20, }, 1200: { slidesperview: 3, spacebetween: 20, }, 1700: { slidesperview: 3, spacebetween: 30, }, }, }); var newswiper2 = new swiper(".newswiper2", { slidesperview: 4, spacebetween: 70, autoplay: true, navigation: { nextel: ".newsnext2", prevel: ".newsprev2", }, pagination: { el: ".newswiperpagination2", type: "progressbar", progressbarfillclass: "my-pagination-progressbar-fill", }, breakpoints: { 320: { slidesperview: 2, spacebetween: 10, }, 767: { slidesperview: 2, spacebetween: 20, }, 1200: { slidesperview: 3, spacebetween: 20, }, 1700: { slidesperview: 3, spacebetween: 30, }, }, }); var hisswiper = new swiper(".hisswiper", { slidesperview: 4, spacebetween: 70, autoplay: true, navigation: { nextel: ".hisnext", prevel: ".hisprev", }, breakpoints: { 320: { slidesperview: 2, spacebetween: 10, }, 767: { slidesperview: 3, spacebetween: 20, }, 1200: { slidesperview: 4, spacebetween: 20, }, 1700: { slidesperview: 5, spacebetween: 30, }, }, }); var facswiper = new swiper(".facswiper", { slidesperview: 4, spacebetween: 70, autoplay: true, navigation: { nextel: ".facnext", prevel: ".facprev", }, breakpoints: { 320: { slidesperview: 2, spacebetween: 10, }, 767: { slidesperview: 3, spacebetween: 20, }, 1200: { slidesperview: 3, spacebetween: 20, }, 1700: { slidesperview: 3, spacebetween: 30, }, }, }); var recomswiper = new swiper(".recomswiper", { slidesperview: 4, spacebetween: 70, autoplay: true, navigation: { nextel: ".recomnext", prevel: ".recomprev", }, breakpoints: { 320: { slidesperview: 1, spacebetween: 10, }, 767: { slidesperview: 3, spacebetween: 20, }, 1200: { slidesperview: 3, spacebetween: 20, }, 1700: { slidesperview: 3, spacebetween: 30, }, }, }); $(".homesec4 .title a").click(function () { var index = $(".homesec4 .title a").index(this) $(this).addclass("active") $(this).siblings().removeclass("active") if (index == 0) { $(".homesec4 .newswiper1").css({ opacity: 1, zindex: 2 }); $(".homesec4 .newswiper2").css({ opacity: 0, zindex: 1, }); } else { $(".homesec4 .newswiper1").css({ opacity: 0, zindex: 1, }); $(".homesec4 .newswiper2").css({ opacity: 1, zindex: 2, }); } }); var isnew = true; $(".homesec2").on("inview", function (event, isinview) { if (isnew) { isnew = false; $(".count").countto(); } }); var isnew1 = true; $(".absec1").on("inview", function (event, isinview) { if (isnew1) { isnew1 = false; $(".count1").countto(); } }); var isnew2 = true; $(".yfs3").on("inview", function (event, isinview) { if (isnew2) { isnew2 = false; $(".num").countto(); } }); $(".rightnav ul li").click(function () { $(this).toggleclass("active"); $(this).siblings().removeclass("active"); $(this).find(".sub").stop().slidetoggle(); $(this).siblings().find(".sub").stop().slideup(); $(".searchcontainer").stop().slidetoggle(); }); $(".rightnav .top .close").click(function () { $(".rightnav").animate({ left: "100vw" }, 100); $("body").removeclass("hidden"); }); $(".header_menu .menu_box").click(function () { $(".rightnav").animate({ left: "0" }, 100); $("body").addclass("hidden"); }); //荣誉弹窗 var licount = $(".honorul li").length; var current = 0; $(".honorul li").click(function () { current = $(".honorul li").index(this); var img = $(this).find("img").attr("src"); $(".honpop").find(".img img").attr("src", img); $(".honpop").addclass('show') }) $(".honpop .next").click(function () { if (current === licount - 1) { console.log("最后一个"); } else { current++; var img = $(".honorul li").eq(current).find("img").attr("src"); $(".honpop").find(".img img").attr("src", img); } }); $(".honpop .prev").click(function () { if (current === 0) { console.log("第一个"); } else { current--; var img = $(".honorul li").eq(current).find("img").attr("src"); $(".honpop").find(".img img").attr("src", img); } }); $(".honpop .close").click(function () { $(".honpop").removeclass("show"); }); //新闻内页右侧固定 // var right = $(window).width() - $(".newsinner .wrap").width(); // var rightnavtop = $(".newsinner .wrap .r").offset().top - 100; // $(window).scroll(function () { // var scrolltop = $(window).scrolltop(); // if (scrolltop >= rightnavtop) { // console.log( // $(window).width(), // $(".newsinner .wrap").width(), // math.ceil(right / 2) // ); // $(".newsinner .wrap .r").css({ // position: "fixed", // top: 100, // right: '5%', // }); // $(".newsinner .wrap .r").addclass("fixed"); // } else { // $(".newsinner .wrap .r").removeclass("fixed"); // } // }); $(".contacts1 .l .top .viewmap").click(function () { $(".mappop").addclass("show") }) $(".mappop .close").click(function () { $(".mappop").removeclass("show"); }); $(".joblist li").click(function () { $(this).toggleclass("active") $(this).find(".jobcon").slidetoggle(); $(this).siblings().removeclass("active") $(this).siblings().find(".jobcon").slideup(); }) $(".procon1 .thumb .item").click(function () { $(this).addclass("active"); $(this).siblings().removeclass("active"); var src = $(this).find("img").attr("src"); $(".procon1 .l .imgcon img").attr('src', src) }) $(".procon1 .thumb .item").each(function () { if ($(this).find("img").length === 0) { $(this).remove() } }) current_nav1 = string($(".pos2").attr("href")); $(".leftnav a").each(function () { if ($(this).attr("href") == current_nav1) { $(this).addclass("active"); } }); $(".innav .l a").each(function () { if ($(this).attr("href") == current_nav1) { $(this).addclass("active"); } }); });