function isIE(){
if(!!window.ActiveXObject || "ActiveXObject" in window){
return true;
}else{
return false;
}
}
//搜索框弹出
$("body,html").click(function(){
$(".search-box").animate({"width":"0.48rem","opacity":"0"});
$(".search-box .s1").animate({"width":"0"});
$(".search-btn").stop(true,true).fadeIn();
});
$(".search-btn").click(function(){
$(this).stop(true,true).fadeOut();
$(".search-box").stop(true,true).animate({"width":"2.48rem","opacity":"1"});
$(".search-box .s1").stop(true,true).animate({"width":"2rem"});
return false;
});
$(".search-box").click(function(){
return false;
});
$('.search_m').click(function() {
$(".searchm_box").fadeIn();
});
$('.searchm_box .icon-close').click(function() {
$(".searchm_box").fadeOut()
});
//移动端导航
$("#selectBut").click(function() {
$(".navm-box").toggleClass("act");
$("body").toggleClass("navShow");
if($("#selectBut").hasClass("hd1-aon1")) {
$(this).removeClass("hd1-aon1")
} else {
$(this).addClass("hd1-aon1")
}
})
$(".nav-wrap .iconfont").click(function(){
if($(this).parent().find("dl").is(":hidden")){
$(this).parent().find("dl").show(500);
$(this).css("transform","rotate(45deg)")
}else{
$(this).parent().find("dl").hide(500);
$(this).css("transform","rotate(0deg)")
}
});
//banner
var mySwiper1 = new Swiper('.banner', {
speed:1200,
loop:true,
centeredSlides: true,
//effect: 'fade',
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
pagination: {
el: '.banner .swiper-pagination',
clickable: true,
renderBullet: function (index, className) {
return '' + '0' + (index + 1) + '';
},
}
});
//鼠标覆盖停止自动切换
mySwiper1.el.onmouseover = function(){
mySwiper1.autoplay.stop();
}
//鼠标离开开始自动切换
mySwiper1.el.onmouseout = function(){
mySwiper1.autoplay.start();
}
//魅力职院左侧滚动图
var mySwiper7 = new Swiper('.pe1 .swiper-container', {
speed:1200,
loop:true,
autoplay: {
delay: 5000,
disableOnInteraction: false,
}
});
//通知公告
var swiper6 = new Swiper('.notice-box .swiper-container', {
loop:true,
slidesPerView: 4,
spaceBetween: 40,
breakpoints: {
880: {
slidesPerView: 3
},
640: {
slidesPerView: 2
},
420: {
slidesPerView: 1
}
}
});
//切换
var mySwiper2 = new Swiper('.pb-box-out', {
speed: 500,
on: {
slideChangeTransitionStart: function () {
$(".pb-title .on").removeClass('on');
$(".pb-title li").eq(this.activeIndex).addClass('on');
}
}
})
var mySwiper21 = new Swiper('.pbin1', {
speed: 500,
effect:'fade',
on: {
slideChangeTransitionStart: function () {
$(".pb-title-in1 .on").removeClass('on');
$(".pb-title-in1 li").eq(this.activeIndex).addClass('on');
}
}
})
var mySwiper22 = new Swiper('.pbin2', {
speed: 500,
effect:'fade',
on: {
slideChangeTransitionStart: function () {
$(".pb-title-in2 .on").removeClass('on');
$(".pb-title-in2 li").eq(this.activeIndex).addClass('on');
}
}
})
var mySwiper23 = new Swiper('.pbin3', {
speed: 500,
effect:'fade',
on: {
slideChangeTransitionStart: function () {
$(".pb-title-in3 .on").removeClass('on');
$(".pb-title-in3 li").eq(this.activeIndex).addClass('on');
}
}
})
$(".pb-title li").on('click', function (e) {
console.log(1);
$(".pb-title .on").removeClass('on')
$(this).addClass('on')
mySwiper2.slideTo($(this).index());
})
$(".pb-title-in1 li").on('click', function (e) {
console.log(1);
$(".pb-title-in1 .on").removeClass('on')
$(this).addClass('on')
mySwiper21.slideTo($(this).index());
})
$(".pb-title-in2 li").on('click', function (e) {
console.log(1);
$(".pb-title-in2 .on").removeClass('on')
$(this).addClass('on')
mySwiper22.slideTo($(this).index());
})
$(".pb-title-in3 li").on('click', function (e) {
console.log(1);
$(".pb-title-in3 .on").removeClass('on')
$(this).addClass('on')
mySwiper23.slideTo($(this).index());
})
//山职数据
var swiper3 = new Swiper('.pdlist', {
loop:true,
slidesPerView: 5,
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
pagination: {
el: '.pdlist .swiper-pagination',
clickable: true,
},
breakpoints: {
920: {
slidesPerView: 4
},
780: {
slidesPerView: 3
},
520: {
slidesPerView: 2
}
},
on: {
init: function(swiper){
$('.counts').countUp({delay: 20,time: 2000});
}
}
});
//专题专栏
var swiper4 = new Swiper('.peblist', {
//loop:true,
slidesPerView: 6,
spaceBetween: 30,
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
breakpoints: {
920: {
slidesPerView: 5
},
780: {
slidesPerView: 4
},
620: {
slidesPerView: 3
},
480: {
slidesPerView: 2
}
}
});
//底部链接
var swiper5 = new Swiper('.flink', {
loop:true,
slidesPerView: 8,
spaceBetween: 20,
autoplay: {
delay: 5000,
disableOnInteraction: false,
},
breakpoints: {
1020: {
slidesPerView: 7
},
880: {
slidesPerView: 6
},
760: {
slidesPerView: 5
},
620: {
slidesPerView: 4
},
480: {
slidesPerView: 3
},
380: {
slidesPerView: 2
},
}
});
//返回顶部
var h = window.innerHeight - $(".header").height();
$(window).scroll(function() {
if ($(this).scrollTop()>h){
$(".to-top").addClass("on");
}else{
$(".to-top").removeClass("on");
};
});
$('.to-top').toTop({
autohide:false,
position:false,
speed:1000
});
//wow
var wow = new WOW({
boxClass: 'wow',
animateClass: 'animated',
offset: 0,
mobile: false,
live: true
});
new WOW().init();
$(".dico1").append('')
$(".dico2").append('')
$(".dico3").append('')
$(".dico4").append('')
$(".dico5").append('')
$(".date-icon").each(function(i) {$(this).find('svg').attr('id', 'svg-' + (i + 1))})
var g = [];
if(!isIE()) {
$(".date-icon svg").each(function(a, b) {
a = $(this).attr("id");
g[a] = new Vivus(a, {
type: "delayed",
duration: 100,
inViewport:true,
autostart:true,
})
});
$(".date-icon").mouseenter(function() {
g[$(this).find("svg").attr("id")].reset().play();
});
}