jquery(function () {
function initbox() {
var mtop = $(".mtop").height();
w_width = jquery(window).width();
w_height = jquery(window).height();
$('.banner-slide figure').css('height', w_height - mtop);
setimgmax($('.banner-slide figure img'), 1728, 888, w_width, w_height - mtop);
};
initbox();
jquery(window).resize(function () {
initbox();
});
var banners = new swiper('.banner', {
speed: 1000,
slidesperview: 1,
parallax: true,
loop: true,
autoheight: true,
autoplay: 4500,
prevbutton: '.banner-prev.prev',
nextbutton: '.banner-prev.next',
pagination: '.banner-numble',
paginationtype : 'custom',
paginationcustomrender: function (swiper, current, total) {
return '0'+current+''+'0'+total+'';
},
oninit: function(swiper){
}
});
var elevideo = document.getelementbyid("video");
elevideo.addeventlistener('ended', function () { //播放中
$(".banner-video").delay("100").fadeout("slow");
$(".play-video").removeclass("show");
$(".play-wr i").html("");
$(".play-wr span").text("play");
});
$(".play-video").click(function(){
$(this).toggleclass("show");
if($(this).hasclass("show")){
$(".banner-video").trigger("play");
$(".banner-video").fadein("slow");
$(".play-wr i").html("");
$(".play-wr span").text("pause");
}else{
$(".banner-video").trigger("puase");
$(".banner-video").fadeout("slow");
$(".play-wr i").html("");
$(".play-wr span").text("play");
}
});
var classic = new swiper('.classic-swiper', {
speed: 1000,
slidesperview: 1,
parallax: true,
loop: true,
autoheight: true,
autoplay: 3500,
paginationclickable: true,
pagination: '.swiper-pagination',
ontransitionstart: function (swiper) {
$('.sunshine').eq(swiper.realindex).stop().fadein("slow").siblings().hide();
},
});
$(".sunnext").click(function(){
classic.slidenext();
});
$(".news-title span").hover(function(){
$(this).addclass("active").siblings().removeclass("active");
$(".news-tab-item").eq($(this).index()).stop().fadein().siblings().hide();
});
$(".news-li li").hover(function(){
$(this).addclass("active").siblings().removeclass("active");
$(this).siblings().find(".news-slide").stop().slideup();
$(this).find(".news-slide").stop().slidedown();
},function(){
$(this).removeclass("active");
$(this).find(".news-slide").stop().slideup();
});
var contentdv = $('.business-small');
if (contentdv.length > 0){
contentdv.each(function(){
$(this).waypoint(function() {
for (i=0;i< contentdv.size();i++){
$(this).find("small").css('opacity','1');
$(this).find("strong").css('opacity','1');
$(this).find("small").textillate({in: {effect: 'fadein',shuffle: true}});
$(this).find("strong").textillate({in: {effect: 'bouncein'}});
}
}, { offset: '100%' });
});
}
});