//首页大图 var sydt = new Swiper ('#sydt', { effect : 'fade', loop: true, // 循环模式选项 speed:300, autoplay : { delay: 3000, disableOnInteraction: false,//用户操作swiper之后,是否禁止autoplay。 }, pagination: { el: '.fy', clickable :true, }, }) //鼠标覆盖停止自动切换 sydt.el.onmouseover = function(){ sydt.autoplay.stop(); } //鼠标离开开始自动切换 sydt.el.onmouseout = function(){ sydt.autoplay.start(); } //学院新闻 var xyxw = new Swiper ('#xyxw', { loop: true, // 循环模式选项 speed:300, autoplay : { delay: 3000, disableOnInteraction: false,//用户操作swiper之后,是否禁止autoplay。 } }) //鼠标覆盖停止自动切换 xyxw.el.onmouseover = function(){ xyxw.autoplay.stop(); } //鼠标离开开始自动切换 xyxw.el.onmouseout = function(){ xyxw.autoplay.start(); } function wordlimit(cname,wordlength){ //参数分别为:类名,要显示的字符串长度 var cname=document.getElementsByClassName(cname); //需要加省略符号的元素对象 for(var i=0;iwordlength){ cname[i].innerText=nowhtml.substr(0,wordlength)+'...'; //截取元素的文本的长度并加上省略号 } } } wordlimit("noticeSummary",36); wordlimit("dynamciTabTitle",16); var tabsSwiper = new Swiper('#tabs-container', { //speed: 500, // effect : 'fade', on: { slideChangeTransitionStart: function() { $(".dynamciTab .active").removeClass('active'); // $(".news-list").hide(); // $(".news-list").eq(this.activeIndex).show(); $(".dynamciTab .columnName").eq(this.activeIndex).addClass('active'); } } }) $(".dynamciTab .columnName").on('mouseover', function(e) { e.preventDefault(); $(".dynamciTab .active").removeClass('active'); $(this).addClass('active'); tabsSwiper.slideTo($(this).index()); }) var showTabsSwiper = new Swiper('#show-tabs', { // effect : 'fade', on: { slideChangeTransitionStart: function() { $(".showTab .active").removeClass('active'); // $(".show-list").hide(); // $(".show-list").eq(this.activeIndex).fadeTo("slow", 1); $(".showTab .columnName").eq(this.activeIndex).addClass('active'); } } }) $(".showTab .columnName").on('mouseover', function(e) { e.preventDefault(); $(".showTab .active").removeClass('active'); $(this).addClass('active'); showTabsSwiper.slideTo($(this).index()); })