// JavaScript Document
$(function () {
var swiper = new Swiper('.zg_banner', {
speed: 700,
effect: 'slide',
fade: {
crossFade: false
},
autoplay: {
delay: 7000,
disableOnInteraction: false
},
loop: true,
pagination: {
el: '.swiper-pagination',
clickable: true
},
navigation: {
nextEl: '.slideNext',
prevEl: '.slidePre',
},
on: {
init: function () {
swiperAnimateCache(this); //隐藏动画元素
swiperAnimate(this); //初始化完成开始动画
},
slideChangeTransitionEnd: function () {
swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
//this.slides.eq(this.activeIndex).find('.ani').removeClass('ani'); 动画只展现一次,去除ani类名
}
}
});
$('.ban4 img').attr({"swiper-animate-effect":"fadeInUp"});
$('.ban5 img').attr({"swiper-animate-effect":"zoomIn"});
$('.ban6 img').attr({"swiper-animate-effect":"fadeInLeft"});
$('.ban7 img').attr({"swiper-animate-effect":"fadeInRight"});
$('.ban8 img').attr({"swiper-animate-effect":"bounceInLeft"});
$('.ban9 img').attr({"swiper-animate-effect":"zoomInLeft"});
$('.ban9 img').attr({"swiper-animate-effect":"fadeInRight"});
$('.ban10 img').attr({"swiper-animate-effect":"fadeInUp"});
$('.ban11 img').attr({"swiper-animate-effect":"fadeInDown"});
$('.ban12 img').attr({"swiper-animate-effect":"zoomInLeft"});
jQuery(".news_list").slide({
mainCell: ".bd ul",
autoPlay: true,
effect: "leftLoop",
interTime: 7000
});
jQuery(".slideTxtBox").slide({});
jQuery(".slideTxtBox02").slide({});
jQuery(".picMarquee-left").slide({
mainCell: ".bd ul",
autoPlay: true,
effect: "leftMarquee",
easing: "swing",
vis: 6,
interTime: 80
});
jQuery(".picMarquee-right").slide({
mainCell: ".bd ul",
autoPlay: true,
effect: "leftMarquee",
easing: "swing",
vis: 6,
opp: true,
interTime: 80
});
//animate
new WOW().init();
$('.counter').countUp();
$(".sear_box").hover(function () {
$(this).addClass('show');
$(this).find(".hs-input").focus()
}, function () {
$(this).removeClass('show')
});
/* 内层图片滚动切换 */
jQuery(".slideGroup .slideBox").slide({
titCell: ".hd ul li",
mainCell: ".bd ul",
vis: 1,
autoPlay: true,
effect: "top",
interTime: 7000,
delayTime: 1200
});
/* 外层tab切换 */
jQuery(".slideGroup").slide({
titCell: ".parHd li",
mainCell: ".parBd",
delayTime: 1200
});
jQuery(".picScroll-top").slide({
titCell: ".hd ul",
mainCell: ".bd ul",
autoPage: true,
effect: "topLoop",
autoPlay: true,
vis: 2
});
jQuery(".picScroll-left").slide({
titCell: ".hd ul",
mainCell: ".bd",
autoPage: true,
effect: "leftLoop",
autoPlay: true,
vis: 3,
interTime: 5000
});
jQuery(".video_spxz").slide({
mainCell: ".bd",
autoPlay: true,
effect: "leftLoop",
interTime: 700000
});
$('.link_list li').each(function () {
$('.link_list li select').change(function () {
var getSelectVal = $('.link_list li option:selected').text();
$('.link_list span').text(getSelectVal);
})
});
//ship
$('.videolist').each(function () { //遍历视频列表
$(this).click(function () { //这个视频被点击后执行
var img = $(this).attr('vpath'); //获取视频预览图
var video = $(this).attr('ipath'); //获取视频路径
$('.videos').html("");
$('.videos').show();
$('.grad_wrap').show();
});
});
$(window).scroll(function () {
if ($(window).scrollTop() >= 1) {
$(".header").addClass("fiextop");
} else {
$(".header").removeClass("fiextop");
}
});
//置顶
$('.bk05').on('click', function () {
$('html,body').animate({
scrollTop: 0
}, 1000)
})
$('.right_xf .bk03').hover(function () {
$(this).find('div').show();
}, function () {
$(this).find('div').hide();
});
$('.right_xf .bk04').hover(function () {
$(this).find('.links_cy').addClass('wid_100');
}, function () {
$(this).find('.links_cy').removeClass('wid_100');
});
$('.close_01').on('click', function () {
$(this).parent('li').hide(500);
})
$('.close_02').on('click', function () {
$('.yc_box').hide(500);
$('.yc_box02').show(500);
})
$('.yc_box02').on('click', function () {
$('.yc_box02').hide(500);
$('.yc_box').show(500);
})
//切换
$(".cydw_hd ul li:first").addClass("on").siblings('li').removeClass('on');
$(".cate_box").eq(0).show().siblings(".cate_box").hide();
$('.cydw_hd ul li').each(function () {
$(this).on('click', function () {
$(this).addClass('on').siblings('li').removeClass('on');
$('.cate_box').hide(500);
$('.cate_box').eq($(this).index()).show(500);
});
});
//tc
function tc(a, b, c, d) {
$(a).click(function () {
$(b).fadeIn(300);
$(c).fadeIn(300);
});
$(d).click(function () {
$(b).fadeOut(300);
$(c).fadeOut(300);
});
}
tc(".btn_link01", ".pop01", ".grad_wrap", ".colse_btn");
tc(".btn_link02", ".pop02", ".grad_wrap", ".colse_btn");
tc(".btn_link03", ".pop03", ".grad_wrap", ".colse_btn");
tc(".btn_link04", ".pop04", ".grad_wrap", ".colse_btn");
var swiper = new Swiper('.scroll_box03', {
scrollbar: {
el: '.swiper-scrollbar',
hide: false,
},
freeMode: true,
scrollbarHide: true,
slidesPerView: 'auto',
preventClicks: false,
centeredSlides: false,
spaceBetween: 0,
grabCursor: true
});
swiper.scrollbar.$el.css('height', '15px');
})
function close1() {
var v = document.getElementById('video'); //获取视频节点
$('.videos').hide(); //点击关闭按钮关闭暂停视频
$('.grad_wrap').hide();
v.pause();
$('.videos').html();
}