$(function(){ /*图alt替换*/ $("* img").attr({alt:"毕节医学高等专科学校",title:"毕节医学高等专科学校"}); /*首页滚动swipoer*/ $require(['swiper'], function () { var honoRBox = new Swiper ('.honoRBox', { speed: 1500, autoplay: true, loop: true, slidesPerView :2, spaceBetween : 10, watchSlidesVisibility: true, centerInsufficientSlides: true, autoplayDisableOnInteraction : false, navigation: { nextEl: '.honoRBoxBB .swiper-button-next', prevEl: '.honoRBoxBB .swiper-button-prev', }, breakpoints: { 768: { slidesPerView :4, spaceBetween : 20 } } }); }); /*首页资质滚动swipoer*/ $require(['swiper'], function () { var honoRBox = new Swiper ('.honoRBox010', { speed: 1500, autoplay: true, loop: true, slidesPerView :2, spaceBetween : 15, watchSlidesVisibility: true, centerInsufficientSlides: true, autoplayDisableOnInteraction : false, navigation: { nextEl: '.honoRBoxBB010 .swiper-button-next', prevEl: '.honoRBoxBB010 .swiper-button-prev', }, breakpoints: { 768: { slidesPerView :1, spaceBetween : 0 } } }); }); /* 循环体a标签选中高亮,多用于分类*/ var Url = window.location.pathname + window.location.search; $(".p_list a").each(function () { //判断分类导航里面的rel和url地址是否相等 if ((Url).indexOf($(this).attr('href')) > -1&&$(this).attr('href')!='') { $(this).addClass('active'); urlstatus = true; } else { $(this).removeClass('active'); } }); /* 分类选中高亮,多用于分类*/ var urlName = window.location.pathname; $('.NavList_a1 .swiper-slide a').each(function(){ var urlHref = $(this).attr('href'); if (urlName.indexOf(urlHref)>=0){ $(this).addClass('active'); } }); });