$(function () { var focusEffect = "fade", teacherSlidesPerView = 5, spaceBetween = 20; function screen() { if($("body").width() <= 750){ focusEffect = "slide"; teacherSlidesPerView = 1; spaceBetween = 0; } else { focusEffect = "fade"; teacherSlidesPerView = 5; spaceBetween = 20; } } screen(); $(window).resize(function(){ screen() }); new Swiper('.swiper-container-focus', { loop: true, effect: focusEffect, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' }, pagination: { el: '.swiper-pagination', clickable: true, }, }); new Swiper('.teacher-swiper-container', { loop: true, speed: 1500, slidesPerView: teacherSlidesPerView, spaceBetween: spaceBetween, centeredSlides: true, watchSlidesProgress: true, on: { setTranslate: function () { slides = this.slides; for (i = 0; i < slides.length; i++) { slide = slides.eq(i); progress = slides[i].progress; //slide.html(progress.toFixed(2)); 鐪嬫竻妤歱rogress鏄€庝箞鍙樺寲鐨 slide.css({'opacity': '', 'background': ''}); slide.transform(''); slide.transform('scale(' + (1 - Math.abs(progress) / 10) + ')'); } }, setTransition: function (transition) { for (var i = 0; i < this.slides.length; i++) { var slide = this.slides.eq(i); slide.transition(transition); } } }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev' } }) }); $(function () { // 鍏徃鍙戝睍鍘嗙▼ $(".carousel-event-new .carousel").jCarouselLite({ btnNext: ".carousel-event-new .j-next", btnPrev: ".carousel-event-new .j-prev", scroll:1, visible:1, speed: 1000, circular:0 }); new Swiper('.swiper-container-event',{ loop:0, autoplay:0, navigation: { nextEl: '.event-swiper-button-next', prevEl: '.event-swiper-button-prev' } }); }); // 鍏徃鍙戝睍鍘嗙▼ hover year 婊戝姩鏁堟灉 $(function(){ $('.evt-year').hover( function(){ var $desc = $(this).parent().find('.evt-desc'); $desc.stop().animate({'scrollTop':$desc.outerHeight()+300},4000) }, function(){ $(this).parent().find('.evt-desc').stop().animate({'scrollTop':"0"},500) }) }); $(function () { var imgNames = [22,0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]; var url = '/assets/home/img/medal/'; imgNames.forEach(function (e) { var li = '
  • '; $('.medal-honor-list').append(li) }); $(".medal-honor .carousel").jCarouselLite({ btnNext: ".medal-honor .j-prev", btnPrev: ".medal-honor .j-next", scroll: 1, start: 0, // auto:1, visible: 5, speed: 1000 }); }); $(function () { $(".wrap-dreams .box>li").hover(function () { $(this).addClass("active").siblings().removeClass("active") }); var mediaIndex = 0, total = 2; $(".wrap-media .news-dt>li").hover(function () { $(this).addClass("active").siblings().removeClass("active"); mediaIndex = $(this).index(); $(".wrap-media .news-item-box>ul").eq(mediaIndex).addClass("news-item-show").siblings().removeClass("news-item-show") }); $(".wrap-media .news-item>li").hover(function () { $(this).addClass("active").siblings().removeClass("active") }); // 鐐瑰嚮鍒囨崲 $(".switch-left").on("click", function () { mediaIndex--; if (mediaIndex < 0) mediaIndex = 0; switchNews(mediaIndex); }); $(".switch-right").on("click", function () { mediaIndex++; if (mediaIndex > total) mediaIndex = total; switchNews(mediaIndex); }); function switchNews(index) { $(".wrap-media .news-dt>li").eq(index).addClass("active").siblings().removeClass("active") $(".wrap-media .news-item-box>ul").eq(index).addClass("news-item-show").siblings().removeClass("news-item-show") } }); $(function () { $('.digital li').appear(function () { var $t = $(this), n = $t.find(".count-text").attr("data-stop"), r = parseInt($t.find(".count-text").attr("data-speed"), 10); if (!$t.hasClass("counted")) { $t.addClass("counted"); $({ countNum: $t.find(".count-text").text() }).animate({ countNum: n }, { duration: r, easing: "linear", step: function () { $t.find(".count-text").text(Math.floor(this.countNum)); }, complete: function () { $t.find(".count-text").text(this.countNum); } }); } }, {accY: 0}); }); $(function () { $.post('//get.aihuagrp.com/teacher/getAll', '', function (res) { if (res.errCode === 0) { var host = 'http://aihuagrp.com', data = []; res.data.forEach(function (e, i) { var obj = { img: host + e.pic, title: e.teacher_name + '   ' + e.academy, url: '', onclick: 'return false' }; data.push(obj) }); new posterTvGrid('posterTvGrid', {height: 400, btitle: !0}, data) } else { $('#posterTvGrid').hide() } }, 'json') });