window.onload = function () { var widthNum = window.screen.width; // 导航 $('.mobile-menu').click(function (e) { e.preventDefault(); if($(this).hasClass('active')){ $('.page-nav').hide() $(this).removeClass('active') $(this).html('') } else { $('.page-nav').show() $(this).addClass('active') $(this).html('') } }); //日历 var calendar = new Swiper('.calendar-swiper', { autoHeight:true, slidesPerView : 1, allowTouchMove: false, navigation: { nextEl: '.calendar-next-btn', prevEl: '.calendar-prev-btn', }, }) var topNewsSwiper = new Swiper('.top-news-swiper', { autoHeight:true, slidesPerView : 1, allowTouchMove: false, navigation: { nextEl: '.calendar-next-btn', prevEl: '.calendar-prev-btn', }, }) //工作动态 var swiper1 = new Swiper('.work-moving .swiper-container', { autoplay: true, slidesPerView : 3, spaceBetween : 36, autoHeight:true, loop: true, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, breakpoints: { 768: { slidesPerView: 1, }, 900: { slidesPerView: 2, }, 1366: { slidesPerView: 3, }, }, }) // 专家解读 $('.interpret .img-item').click(function (e) { e.preventDefault(); $(this).addClass('cur') $(this).siblings().removeClass("cur"); var name = $(this).find('.name').text(); var link = $(this).find('.link').attr('href'); console.log(link); console.log(name,'name'); $('.interpret .list-detail .name').text(name) var text = $(this).find('.text').text(); console.log(text,'text'); $('.interpret .list-detail .text').text(text) $('.interpret .list-detail a').attr("href",link); }); // 放映大厅 var galleryThumbs = new Swiper('.gallery-thumbs-box .swiper', { spaceBetween: 10, slidesPerView: 5, autoHeight:true, loop:true, centeredSlides: true, navigation: { nextEl: '.gallery-top-prev', prevEl: '.gallery-top-next', }, breakpoints: { 900: { slidesPerView: 3, }, 1366: { slidesPerView: 5, }, }, }); var galleryTop = new Swiper('.gallery-top', { loop: true, autoHeight:true, autoplay: true, delay: 5000, thumbs: { swiper: galleryThumbs, }, }); // 喜迎 $('.detail_tag .detail_box').click(function(){ var index= $(this).index() $(this).siblings().removeClass("active"); $(this).addClass("active"); $('.footer_detail .tab-bd').removeClass('active') $('.footer_detail .tab-bd').eq(index).addClass('active') }) // 入场动画 AOS.init({ asing: 'ease-out-back', duration: 1000, once:true, disable:window.innerWidth < 1200 }); }