//移动端导航 $(".selectBut").click(function() { $(".navm-box").toggleClass("act"); $("body").toggleClass("navShow"); if($(".selectBut").hasClass("hd1-aon1")) { $(this).removeClass("hd1-aon1"); $(".masklayer").hide() } else { $(this).addClass("hd1-aon1"); $(".masklayer").fadeIn("slow") } }) $(".nav-wrap .icon-jia").click(function(){ if($(this).parent().find("dl").is(":hidden")){ $(this).parent().find("dl").show(500); $(this).css("transform","rotate(180deg)") }else{ $(this).parent().find("dl").hide(500); $(this).css("transform","rotate(0deg)") } }); //搜索 $('.search').click(function(){ $('.search_wrap').fadeIn(); }); $('.search_wrap .bck').click(function(){ $('.search_wrap').fadeOut("slow"); }); //banner var mySwiper1 = new Swiper('.banner .swiper-container', { speed:1200, loop:true, centeredSlides: true, autoplay: { delay: 5000, disableOnInteraction: false, }, pagination: { el: '.banner .swiper-pagination', clickable: true, } }); //新闻滚动图 var mySwiper4 = new Swiper('.news-scroll .swiper-container', { speed:800, loop:true, centeredSlides: true, autoplay: { delay: 5000, disableOnInteraction: false, }, pagination: { el: '.news-scroll .swiper-pagination', clickable: true, } }); //学术动态 var mySwiper5 = new Swiper('.pb2-left .swiper-container', { speed:800, loop:true, autoplay: { delay: 5000, disableOnInteraction: false, } }); //年度报告 var mySwiper6 = new Swiper('.rep-list .swiper-container', { slidesPerView: 5, spaceBetween: 20, loop:true, autoplay: { delay: 5000, disableOnInteraction: false, }, breakpoints: { 1060:{ slidesPerView: 4, spaceBetween: 20, }, 880:{ slidesPerView: 3, spaceBetween: 20, }, 580:{ slidesPerView: 2, spaceBetween: 20, }, 400:{ slidesPerView: 1, spaceBetween: 20, } } }); //数据电光 var mySwiper7 = new Swiper('.data-list .swiper-container', { slidesPerView: 5, loop:true, autoplay: { delay: 5000, disableOnInteraction: false, }, breakpoints: { 880:{ slidesPerView: 4, }, 720:{ slidesPerView: 3, }, 530:{ slidesPerView: 2, } }, pagination: { el: '.data-list .swiper-pagination', clickable: true, }, on: { init: function(mySwiper7){ $('.data span').countUp({delay: 20,time: 2000}); } } }); /*切换 var mySwiper2 = new Swiper('.qh-box .swiper-container', { speed: 500, effect: 'fade', allowTouchMove: false, on: { slideChangeTransitionStart: function () { $(".qh-title .on").removeClass('on'); $(".qh-title li").eq(this.activeIndex).addClass('on'); } } }); $(".qh-title li").on('mousemove', function (e) { $(".qh-title .on").removeClass('on'); $(this).addClass('on'); mySwiper2.slideTo($(this).index()); });*/ $(function () { $(window).scroll(function(){ var scroH = $(window).scrollTop(); if(scroH > 300){ $(".r_nav").addClass("show"); }else{ $(".r_nav").removeClass("show"); } $(".years_con").each(function () { if($(this).offset().top <= (scroH + 40)){ //判断滚动条位置 var id = $(this).prop("id"); $('.r_nav_list a').removeClass("on"); //清除c类 $(".r_nav_list a[href='#"+id+"']").addClass("on"); //给当前导航加c类 } }) }); $(".r_nav_list a").click(function () { $($(this).attr("href")).addClass("color").siblings().removeClass("color"); $("html, body").animate({scrollTop: $($(this).attr("href")).offset().top - 100 + "px"}, 500); return false; }); $(".r_nav_start .eject").click(function(){ $(this).parent().stop().animate({right:"-100%"},400,function(){$(".r_nav_list").stop().animate({right:"0"},400);}) }) $(".r_nav_list .recover").click(function(){ $(this).parent().stop().animate({right:"-100%"},400); $(".r_nav_start").stop().animate({right:"0"},400) }) });