$(function () { if ($(window).width() > 750) { new WOW().init({ mobile: false, }); } // 首页轮播图 var swiper111 = new Swiper(".banner .mySwiper", { pagination: { el: ".banner .swiper-pagination", clickable: true, renderBullet: function (a, b) { return '0' + (a + 1) + ""; }, }, watchOverflow: true, effect: "fade", autoplay: { delay: 3000, disableOnInteraction: false, }, speed: 1000, }); // 子页轮播图 var swiper = new Swiper(".zy_banner .mySwiper", { watchOverflow: true, effect: "fade", autoplay: { delay: 3000, disableOnInteraction: false, }, speed: 1000, }); // 首页新闻轮播 var swiper = new Swiper(".index_news_left .mySwiper", { navigation: { nextEl: ".index_news_left .swiper-button-next", prevEl: ".index_news_left .swiper-button-prev", }, pagination: { el: ".index_news_left .swiper-pagination", clickable: true, }, watchOverflow: true, autoplay: { delay: 3000, disableOnInteraction: false, }, }); if ($(window).width() > 750) { var swiper = new Swiper(".index_news_right .mySwiper", { navigation: { nextEl: ".index_news_right .swiper-button-next", prevEl: ".index_news_right .swiper-button-prev", }, slidesPerView: 5, direction: "vertical", loop: true, autoplay: { delay: 3000, disableOnInteraction: false, }, }); } // 首页横幅 var swiper = new Swiper(".module3 .mySwiper", { pagination: { el: ".module3 .swiper-pagination", clickable: true, renderBullet: function (index, className) { return '' + (index + 1) + ""; }, }, }); // 首页手机横幅 var swiper = new Swiper(".sj_module3 .mySwiper", { pagination: { el: ".sj_module3 .swiper-pagination", clickable: true, renderBullet: function (index, className) { return '' + (index + 1) + ""; }, }, }); // // 搜索 // $(".search>img").click(function () { // $(".serpc").fadeIn(); // }); // $(".search_close").click(function () { // $(".serpc").fadeOut(); // }); $(window).scroll(function () { $(".serpc").fadeOut(); var scrollPos = $(window).scrollTop(); if (scrollPos > 0) { $("body").addClass("scrolling"); } else { $("body").removeClass("scrolling"); } }); // 学术活动 var swiper = new Swiper(".module4 .mySwiper", { breakpoints: { 320: { //当屏幕宽度大于等于320 slidesPerView: 1.25, spaceBetween: 30, }, 768: { //当屏幕宽度大于等于768 slidesPerView: 1.25, spaceBetween: 30, }, 1280: { //当屏幕宽度大于等于1280 slidesPerView: 3, spaceBetween: 14, }, }, watchOverflow: true, // pagination: { // el: ".swiper-pagination", // clickable: true, // }, autoplay: { delay: 3000, disableOnInteraction: false, }, speed: 1000, }); // 主题教育切换 var swiper1 = new Swiper(".swi1 .mySwiper", { breakpoints: { 320: { //当屏幕宽度大于等于320 slidesPerView: 1.6, spaceBetween: 24, }, 768: { //当屏幕宽度大于等于768 slidesPerView: 1.6, spaceBetween: 24, }, 1280: { //当屏幕宽度大于等于1280 slidesPerView: 4, spaceBetween: 14, }, }, watchOverflow: true, // pagination: { // el: ".swiper-pagination", // clickable: true, // }, autoplay: { delay: 3000, disableOnInteraction: false, }, speed: 1000, }); // 通知公告 var swiper = new Swiper(".module6 .mySwiper", { breakpoints: { 320: { //当屏幕宽度大于等于320 slidesPerView: 1, spaceBetween: 30, }, 768: { //当屏幕宽度大于等于768 slidesPerView: 1, spaceBetween: 30, }, 1280: { //当屏幕宽度大于等于1280 slidesPerView: 4, spaceBetween: 14, }, }, watchOverflow: true, pagination: { el: ".swiper-pagination", clickable: true, }, autoplay: { delay: 3000, disableOnInteraction: false, }, speed: 1000, }); // 点击首页视频按钮显示视频弹窗 $(".module5 .video_play").click(function () { $(".module5 .video_link").fadeIn(); $("html").css("overflow", "hidden", "height", "100vh"); }); $(".module5 .video_close").click(function () { $(".module5 .video_link").fadeOut(); $("html").css("overflow", "auto", "height", "auto"); }); $(".search").click(function () { $("#search").addClass("showdiv"); }); // 关闭搜索框 $("#search .close").click(function () { $("#search").removeClass("showdiv"); }); $(".menu").click(function () { $("body").toggleClass("navShow"); $("html").toggleClass("on"); if ($(".sj_head .sj_head_t").hasClass("on")) { } else { $(".sj_head .sj_head_t").addClass("on"); } }); // 手机子页切换 $(".click_nav").click(function () { $(this).toggleClass("on"); $(".zy_sj_nav ul").toggleClass("on") }); });