//移动端导航 $(".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('.pb-left .swiper-container', { speed:800, loop:true, autoplay: { delay: 5000, disableOnInteraction: false, } }); //合作交流 var mySwiper6 = new Swiper('.pb-center .swiper-container', { speed:800, loop:true, autoplay: { delay: 5000, disableOnInteraction: false, } }); //年度报告 var mySwiper3 = new Swiper(".stu_box .swiper-container", { slidesPerView: 4, spaceBetween: 30, autoplay: { delay: 5000, disableOnInteraction: false, }, breakpoints: { 1060:{ slidesPerView: 4, spaceBetween: 30, }, 980:{ slidesPerView: 3, spaceBetween: 30, }, 780:{ slidesPerView: 2, spaceBetween: 20, }, 480:{ slidesPerView: 1, spaceBetween: 20, }, 380:{ 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) }) }); var spans = ''; for (i = 1; i <= 4; i++) { spans += ''; } $('.homef .cirs').html(spans); var slide_f = new Swiper('.slide-f', { loop: true, speed: 1000, slidesPerView: 5, spaceBetween: 0, noSwiping: true, noSwipingClass: 'noSwi', autoplay: {delay: 5000,stopOnLastSlide: false,disableOnInteraction: false}, centeredSlides: true, watchSlidesProgress: true, slideToClickedSlide: true, on: { setTranslate: function () { slides = this.slides for (i = 0; i < slides.length; i++) { slide = slides.eq(i) progress = slides[i].progress slide.transform('translate3d(0,' + Math.abs(progress) * .5 + 'rem, 0)'); // console.log(Math.abs(progress)) } }, setTransition: function (transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i) slide.transition(transition); } }, }, navigation: { nextEl: '.homef .next', prevEl: '.homef .prev', }, breakpoints: { 750: { slidesPerView: 3 }, 1025: { slidesPerView: 5 } } });