//$(function() { //头图 var swiperFlag = false; var BannerSwiper = new Swiper('.swiper1', { autoplay: { delay: 5000, disableOnInteraction: false }, // autoplay: false, // loop: true, effect: 'fade', draggable: false, allowTouchMove: true, watchSlidesProgress: true, fadeEffect: { crossFade: true }, pagination: { el: ".Banner .Banner-dots", // clickable: true, clickable: !0, bulletActiveClass: 'active', renderBullet: function (index, className) { return ''; } }, // lazy: { // loadPrevNext: true, // elementClass : 'swiper-lazy', // loadOnTransitionStart: true, // }, on: { transitionStart: function () { delay = this.params.autoplay.delay; anime({ targets: ".Banner .Banner-dots span i", delay: 0, width: ["0", "100%"], easing: "linear", duration: delay }); }, slideChange: function (swiper) { var _this = $('.swiper1 .swiper-slide').eq(this.activeIndex); if (!swiperFlag) { swiperFlag = true; } else { videoSelect(_this); } } } }) videoSelect($('.swiper1 .swiper-slide.swiper-slide-active')); function videoSelect(_this) { var flag = true; var cc = _this.hasClass('ban_video'); if (cc) { BannerSwiper.autoplay.stop(); var videos = ''; _this.find('.slick_img').append(videos); _this.find('video').bind('ended', function () { BannerSwiper.slideNext(); BannerSwiper.autoplay.start(); }); } else { $('.vv').remove(); } } $('.Banner .Banner-dots span').click(function () { BannerSwiper.autoplay.start(); }) anime({ targets: ".Banner .Banner-dots .active i", width: ["0", "100%"], easing: "linear", duration: 5000 }); $('.BISTU_list2 li a').each(function (e) { var html0 = $(this).html(); // if(e < 4){ // } $(this).empty().append('' + html0 + '') }) $('.BISTU_list6 h3').each(function (e) { var html0 = $(this).html(); $(this).empty().append('' + html0 + '') }) var slideNews = new Swiper('.BISTU_list2', { speed: 1000, // delay: 4000, // loop:true, autoplay: true, effect: 'fade', allowTouchMove: true, watchSlidesProgress: true, fadeEffect: { crossFade: true }, // navigation: { // nextEl: '.homea .next', // prevEl: '.homea .prev', // }, pagination: { el: ".mode01 .rt .Banner-dots", // clickable: true, clickable: !0, bulletActiveClass: 'active', renderBullet: function (index, className) { return ''; } }, on: { transitionStart: function () { delay = this.params.autoplay.delay; anime({ targets: ".mode01 .rt .Banner-dots span i", delay: 0, width: ["0", "100%"], easing: "linear", duration: delay }); } } }); // 专题切换 var slideXb = new Swiper('.BISTU_list8', { loop: true, slidesPerView: 1, onSlideChangeStart: function (swiper) { $(".topic_list li").eq(swiper.activeIndex - 1).addClass('on').siblings().removeClass('on'); }, autoplay: false, speed: 600, lazyLoading: true, lazyLoadingInPrevNext: true, lazyLoadingInPrevNextAmount: 1, lazyLoadingOnTransitionStart: true, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesPerView: 2, spaceBetween: 10 }, 480: { //当屏幕宽度大于等于768 slidesPerView: 1, spaceBetween: 20 } } }); $(".topic_list li").hover(function () { $(this).addClass('on').siblings().removeClass('on'); slideXb.slideTo($(this).index() + 1) }) // 数说信科 var total = $('.BISTU_number .swiper-slide').length; var slideNews = new Swiper('.BISTU_number', { speed: 1000, // delay: 4000, // loop:true, autoplay: true, effect: 'slide', allowTouchMove: true, spaceBetween: 40, watchSlidesProgress: true, slidesPerView: 5, fadeEffect: { crossFade: true }, watchSlidesVisibility: true, slideVisibleClass: 'slide-visible', // navigation: { // nextEl: '.homea .next', // prevEl: '.homea .prev', // }, pagination: { el: ".mode06 .Banner-dots", // clickable: true, clickable: !0, bulletActiveClass: 'active', renderBullet: function (index, className) { return ''; } }, on: { init: function () { changePositon() }, transitionStart: function () { delay = this.params.autoplay.delay; anime({ targets: ".mode06 .Banner-dots span i", delay: 0, width: ["0", "100%"], easing: "linear", duration: delay }); changePositon() }, transitionEnd: function () { $('.counter').each(function () { $(this).countTo().addClass("counted"); }); }, }, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesPerView: 2, spaceBetween: 10 }, 640: { //当屏幕宽度大于等于768 slidesPerView: 5, spaceBetween: 20 }, 1280: { //当屏幕宽度大于等于1280 slidesPerView: 5, spaceBetween: 20 }, 1460: { //当屏幕宽度大于等于1280 slidesPerView: 5, spaceBetween: 40 } } }); anime({ targets: ".mode06 .Banner-dots .active i", width: ["0", "100%"], easing: "linear", duration: 5000 }); function changePositon() { for (var i = 0; i < total; i++) { $('.slide-visible').removeClass('nth' + i) } $('.slide-visible').removeClass('nth0') $('.slide-visible').each(function (e) { $(this).addClass('nth' + e) }) } window.onload = function () { lazyload(); } $(window).scroll(function () { lazyload(); }); //学校要闻 $('.BISTU_list1 li h3').each(function () { var html0 = $(this).html(); $(this).empty().append('' + html0 + '') }) var winW = window.innerWidth; if (winW <= 480) { $('.BISTU_list1 ').addClass('swiper-wrapper') $('.BISTU_list1 li').each(function () { $(this).addClass('swiper-slide') }) var slideNews2 = new Swiper('.newsColumn', { speed: 1000, // delay: 4000, // loop:true, autoplay: true, effect: 'slide', allowTouchMove: true, watchSlidesProgress: true, fadeEffect: { crossFade: true }, // navigation: { // nextEl: '.homea .next', // prevEl: '.homea .prev', // }, pagination: { el: ".mode01 .lf .Banner-dots", // clickable: true, clickable: !0, bulletActiveClass: 'active', renderBullet: function (index, className) { return ''; } }, on: { transitionStart: function () { delay = this.params.autoplay.delay; anime({ targets: ".mode01 .lf .Banner-dots span i", delay: 0, width: ["0", "100%"], easing: "linear", duration: delay }); } } }); } //科学研究 var winW = window.innerWidth; if (winW <= 480) { var html1 = '
  • ' + $('.researchCol').html() + '
  • '; var html2 = ''; var html3 = '' $('.BISTU_list3').eq(0).find('li').each(function () { $(this).addClass('swiper-slide'); html2 += '
  • ' + $(this).html() + '
  • ' }) $('.BISTU_list4').find('li').each(function () { $(this).addClass('swiper-slide'); html3 += '
  • ' + $(this).html() + '
  • ' }) var resHtml = ''; $('.row2').empty().append(resHtml); var slideResearch = new Swiper('.mode02 .row2', { speed: 1000, // delay: 4000, // loop:true, autoplay: true, effect: 'slide', allowTouchMove: true, watchSlidesProgress: true, fadeEffect: { crossFade: true }, // navigation: { // nextEl: '.homea .next', // prevEl: '.homea .prev', // }, pagination: { el: ".mode02 .row2 .Banner-dots", // clickable: true, clickable: !0, bulletActiveClass: 'active', renderBullet: function (index, className) { return ''; } }, on: { transitionStart: function () { delay = this.params.autoplay.delay; anime({ targets: ".mode02 .row2 .Banner-dots span i", delay: 0, width: ["0", "100%"], easing: "linear", duration: delay }); } } }); } //菁菁校园 var winW = window.innerWidth; if (winW <= 640) { $('.BISTU_list6 ').addClass('swiper-wrapper').wrap('
    ') $('.jjxyColumn').append('
    ') $('.BISTU_list6 li').each(function () { $(this).addClass('swiper-slide') }) var slideNews2 = new Swiper('.jjxyColumn', { speed: 1000, // delay: 4000, // loop:true, autoplay: true, effect: 'slide', allowTouchMove: true, watchSlidesProgress: true, fadeEffect: { crossFade: true }, // navigation: { // nextEl: '.homea .next', // prevEl: '.homea .prev', // }, pagination: { el: ".jjxyColumn .Banner-dots", // clickable: true, clickable: !0, bulletActiveClass: 'active', renderBullet: function (index, className) { return ''; } }, on: { transitionStart: function () { delay = this.params.autoplay.delay; anime({ targets: ".jjxyColumn .Banner-dots span i", delay: 0, width: ["0", "100%"], easing: "linear", duration: delay }); } } }); } // //焦点新闻 // $('.slick-news').slick({ // slidesToShow: 1, // arrows: true, // dots: false, // infinite: true, // speed: 800, // autoplay:true, // autoplaySpeed: 5000, // fade:true // }) // //焦点新闻文字 // $('.slick-news2').slick({ // slidesToShow: 3, // arrows: true, // dots: false, // infinite: true, // speed: 800, // autoplay:true, // autoplaySpeed: 5000, // // fade:true, // responsive: [ // { // breakpoint: 996, // settings: { // slidesToShow: 2, // slidesToScroll: 2, // infinite: true, // dots: true // } // }, // { // breakpoint: 600, // settings: { // slidesToShow: 2, // slidesToScroll: 2, // dots: true // } // }, // { // breakpoint: 480, // settings: { // slidesToShow: 1, // slidesToScroll: 1, // dots: true // } // } // ] // }) // //国际合作 // $('.slick-news3').slick({ // slidesToShow: 1, // arrows: false, // dots: true, // infinite: true, // speed: 800, // autoplay:true, // autoplaySpeed: 5000, // // fade:true, // responsive: [ // { // breakpoint: 996, // settings: { // infinite: true, // dots: true // } // }, // { // breakpoint: 600, // }, // { // breakpoint: 480, // } // ] // }) // $('.CFAU-list6').slick({ // slidesToShow: 6, // arrows: false, // dots: true, // infinite: true, // speed: 800, // autoplay:true, // autoplaySpeed: 5000, // slidesToScroll: 6, // // fade:true, // responsive: [ // { // breakpoint: 996, // settings: { // slidesToShow: 4, // slidesToScroll: 4, // infinite: true, // dots: true // } // }, // { // breakpoint: 600, // settings: { // slidesToShow: 3, // slidesToScroll: 3, // dots: true // } // } // ] // }) $(window).resize(function () { var resizeTimer = null; if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(function () { directionNav() //头图箭头切换 }, 100); }) directionNav() //头图箭头切换 function directionNav() { $('.slick-arrow').each(function (e) { var $this = $(this) $this.text(''); $(this).addClass('iconfont') if ($this.hasClass('slick-prev')) { $(this).addClass('icon-prev') } else if ($this.hasClass('slick-next')) { $(this).addClass('icon-next') } }) } //}) // AOS.init({ // offset: 200, // easing: 'ease-in-sine', // duration: 800, // once:true // }); $(".tab1").tab({ ev: 'mouseover', more: true, auto: true,speed: 5000 }); /* tab切换 例调用:$(".tab").tab({ev : 'mouseover',more : false,auto : false}); */ ; (function ($) { $.fn.extend({ tab: function (options) { var defaults = { //默认参数 ev: 'mouseover', //默认事件'mouseover','click' delay: 100, //延迟时间 auto: true, //是否自动切换 true,false speed: 2000, //自动切换间隔时间(毫秒) more: false //是否有more,false,true }; var options = $.extend(defaults, options); //用户设置参数覆盖默认参数 return this.each(function () { var o = options; var obj = $(this); var oTil = obj.find('.til_tab'); var oBoxs = obj.find('.tabList') var oBox = oBoxs.find('.tabListBox'); var oMore = null; var iNum = 0; var iLen = oTil.length; obj.find('.til_tab').eq(0).addClass('on') oBoxs.each(function () { $(this).find('.tabListBox').eq(0).css('display', 'block') }) obj.find('.more_tab').eq(0).css('display', 'block') //鼠标事件绑定 oTil.bind(o.ev, function () { var _this = this; if (o.ev == 'mouseover' && o.delay) { _this.timer = setTimeout(function () { change(_this); }, o.delay); } else { change(_this); }; }) oTil.bind('mouseout', function () { var _this = this; clearTimeout(_this.timer); }); //自动切换效果 (function autoPlay() { var timer2 = null; if (o.auto) { function play() { iNum++; if (iNum >= iLen) { iNum = 0; }; change(oTil.eq(iNum)); }; timer2 = setInterval(play, o.speed); obj.on('mouseover', function () { clearInterval(timer2); }) obj.on('mouseout', function () { timer2 = setInterval(play, o.speed); }) }; })(); function change(box) { iNum = $(box).index(); oTil.removeClass('on'); // debugger oBoxs.each(function () { $(this).find('.tabListBox').css('display', 'none') }) // oBox.css('display','none'); if (o.more) { oMore = obj.find('.more_tab'); oMore.css('display', 'none'); oMore.eq(iNum).css('display', 'block'); }; oTil.eq(iNum).addClass('on'); // oBox.eq(iNum).css('display','block'); oBoxs.each(function () { $(this).find('.tabListBox').eq(iNum).css('display', 'block') }) } }); } }) })(jQuery);