// 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();
}