$(function() { //头图 $('.slick-images').slick({ arrows: true, dots: true, infinite: true, speed: 1000, fade: true, autoplay: true, cssEase: 'linear', lazyLoad: 'ondemand' }); BannerdirectionNav(); //banner轮播左右箭头切换 if (isTouchDevice()) { $('body').addClass('mobile') $(".mode3").tab({ ev: 'click', more: true, auto: false }); $(".mode3 .tabMenu1 li a").each(function() { $(this).attr('href', 'javascript:void(0)') }) } else { $('body').addClass('desktop') $(".mode3").tab({ ev: 'mouseover', more: true, auto: false }); } //$('.kypt .slick-list1').slick("unslick") $('.kypt .slick-list1').slick({ arrows: false, slidesToShow: 4, slidesToScroll: 1, dots: true, focusOnSelect: true, appendDots: $('.kypt .slick-dots2'), responsive: [{ breakpoint: 996, settings: { slidesToShow: 4, slidesToScroll: 1, } }, { breakpoint: 996, settings: { slidesToShow: 3, } }, { breakpoint: 480, settings: { slidesToShow: 2, } } ] }); $('.kypt .slider-arrow.left').click(function() { $('.kypt .slick-list1').slick('slickPrev', 1); }) $('.kypt .slider-arrow.right').click(function() { $('.kypt .slick-list1').slick('slickNext', 1); }) $('.kycg .slider-arrow.left').click(function() { $('.kycg .slick-list1').slick('slickPrev', 1); }) $('.kycg .slider-arrow.right').click(function() { $('.kycg .slick-list1').slick('slickNext', 1); }) //人才培养基地 $('.slick-images2').slick({ arrows: true, dots: false, infinite: true, speed: 1000, fade: true, cssEase: 'linear', lazyLoad: 'ondemand' }); $('.slick-list2').slick({ arrows: true, slidesToShow: 3, slidesToScroll: 1, dots: false, focusOnSelect: true, responsive: [{ breakpoint: 996, settings: { slidesToShow: 2, } }, { breakpoint: 640, settings: { slidesToShow: 1, } } ] }); directionNav(); //校区故事左右切换 $('.slick-dots li').each(function(e) { // var $this =$(this).find('button'); if ($(this).index() <= 8) { $(this).find('button').text('0' + parseInt($(this).index() + 1)); } }) }); $(window).resize(function() { var resizeTimer = null; if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { directionNav() BannerdirectionNav() }, 100); }) function BannerdirectionNav() { $('.Banner .slick-arrow').each(function(e) { var $this = $(this) $this.text(''); $(this).addClass('iconfont') if ($this.hasClass('slick-prev')) { $(this).addClass('icon-zuo') } else if ($this.hasClass('slick-next')) { $(this).addClass('icon-you') } }) } function directionNav() { $('.slick-images2 .slick-arrow,.slick-list2 .slick-arrow').each(function(e) { var $this = $(this) $this.text(''); $(this).addClass('iconfont') if ($this.hasClass('slick-prev')) { $(this).addClass('icon-zuo') } else if ($this.hasClass('slick-next')) { $(this).addClass('icon-you') } }) }