///banner
$(window).on('load resize', function(){
var wh = $(window).height() - parseint($('.header').outerheight()) - parseint($('.index-notice').outerheight());
$('.pc-ban').height(wh);
});
// pc端banner动画
$(function(){
var w1 = $(window).width();
var slidetime;
var $slide = $('.pc-ban-bd ul li'),
$ctrl = $('.pc-ban-hd'),
leng = $slide.length - 1;
var slidei = 0;
for(var i = 0; i < $slide.length; i++){
$ctrl.append('');
}
if($slide.length > 1){
$ctrl.show();
}else{
$ctrl.hide();
}
function animate() {
$slide.eq(slidei).addclass('visb')
.siblings().removeclass('visb');
$ctrl.find('a').eq(slidei).addclass('on').siblings().removeclass('on');
}
function slideflv(){
slidetime = setinterval(function() {
slidei++;
slidei = slidei > leng ? 0 : slidei;
animate();
}, 8000);
}
animate();
slideflv();
$ctrl.find('a').on('mouseover', function(){
clearinterval(slidetime);
slidei = $(this).index();
animate();
return slidei;
}).on('mouseout', function(){
slideflv();
});
});
// jquery('.pc-ban').slide({
// maincell: '.pc-ban-bd ul',
// titcell: '.pc-ban-hd',
// effect: 'fold',
// autopage: '',
// autoplay: true,
// intertime: 6000,
// delaytime: 5000,
// startfun: function(i,c){
// $('.pc-ban-bd li').eq(i).addclass('visb').removeclass('curs')
// .siblings().removeclass('visb').addclass('curs');
// }
// });
var phbanswip = new swiper ('.ph-ban', {
loop: false,
autoplay : 8000,
autoplaydisableoninteraction: false,
paginationclickable: true,
pagination: '.ph-ban-hd',
bulletclass: 'item',
bulletactiveclass : 'active',
observer:true,
observeparents:true,
oninit: function(swiper){
if(swiper.slides.length > 1){
$(".ph-ban-hd, .pc-ban-hd").show();
}else{
$(".ph-ban-hd, .pc-ban-hd").hide();
}
}
});
/// 公告
var noticeswip = new swiper ('.notice-list', {
loop : true,
slidesperview: 2,
spacebetween: 16,
autoplay : 3000,
autoplaydisableoninteraction: false,
observer:true,
observeparents:true,
breakpoints: {
991: {
slidesperview: 1
}
},
oninit: function(swiper){
noticelenfn(swiper);
}
});
function noticelenfn(swiper){
var ww = $(window).width(),
slidelen = $('.notice-list .swiper-slide:not(".swiper-slide-duplicate")').length;
var $slidedup = $('.notice-list .swiper-slide.swiper-slide-duplicate');
if(ww > 991){
if(slidelen < 3){
swiper.lockswipes();
}else{
swiper.unlockswipes();
}
if(slidelen < 2){
$slidedup.hide();
}else{
$slidedup.show();
}
}else{
if(slidelen < 2){
swiper.lockswipes();
}else{
swiper.unlockswipes();
}
}
}
$(window).on('resize', function(){
noticelenfn(noticeswip);
});
/// 业务领域
var bssswip = new swiper ('.index-bss', {
loop: false,
slidesperview: 4,
slidespergroup: 3,
spacebetween: 20,
autoplay : 5000,
autoplaydisableoninteraction: false,
pagination: '.swiper-page',
bulletclass: 'item',
bulletactiveclass : 'active',
paginationclickable: true,
observer:true,
observeparents:true,
breakpoints: {
991: {
slidesperview: 2,
slidespergroup: 2,
spacebetween: 10
},
767:{
slidesperview: 1,
slidespergroup: 1
}
}
});
// 集团要闻
var newsswip = new swiper ('.news-imgs-slide', {
loop: false,
effect:'fade',
autoplay : 5000,
autoplaydisableoninteraction: false,
pagination: '.swiper-page',
bulletclass: 'item',
bulletactiveclass : 'active',
paginationclickable: true,
observer:true,
observeparents:true,
oninit: function(swiper){
if(swiper.slides.length > 1){
$(".news-imgs-slide .swiper-page").show();
}else{
$(".news-imgs-slide .swiper-page").hide();
}
}
});