new WOW().init();
// 内页图片碎片化
var _default = { width: 1200, line: 5, column: 12, img: '', animeTime: 3000 };
function fragmentImg (changeConfig) { if (typeof (changeConfig) == "object") { for (var n in changeConfig) { _default[n] = changeConfig[n] } } if (!_default.container) { alert('未选择显示容器(div.class or div#id)的类'); return false } var container = $(_default.container); container.append("
"); container.css({ width: _default.width }); var containerUl = container.find(" > ul"); for (var i = 0; i < (_default.line * _default.column); i++) { containerUl.append("") } var containerItem = containerUl.find("li"); var Img = new Image(); Img.src = _default.img; Img.onload = function () { var multiple = container.width() / Img.width, width = Img.width * multiple, height = Img.height * multiple, findWidth = width / _default.column, findHeight = height / _default.line; var windowWidth = screen.width, windowHeight = screen.height; containerItem.css({ width: findWidth, height: findHeight, 'background-image': 'url(' + Img.src + ')', 'background-size': width + 'px ' + height + 'px', opacity: 0 }); container.css({ left: '50%', top: '50%', 'margin-top': -height / 2, 'margin-left': -width / 2 }); var x, y; for (i = 0; i < containerItem.length; i++) { x = i % _default.column; y = Math.floor(i / _default.column); containerItem.eq(i).css({ 'background-position': -x * findWidth + 'px ' + (-y * findHeight) + 'px', left: Math.ceil(Math.random() * windowWidth * 2) - windowWidth, top: Math.ceil(Math.random() * windowHeight * 2) - windowHeight }).animate({ left: 0, top: 0, opacity: 1 }, Math.ceil(Math.random() * (0.33 * _default.animeTime)) + (0.11 * _default.animeTime)) } } }
$(function () {
window.onload = function () { }
$('html head').append('')
if ($('.pageban .textbox').length != 0) {
$('.pageban .textbox').addClass('cur');
}
$('.headtop .line, .logo').addClass('cur');
function togglediv (obj1, obj2, s) { obj1.click(function () { var i = $(this).index(); $(this).addClass('cur').siblings().removeClass('cur'); if (s == "1") { obj2.eq(i).addClass('cur').siblings().removeClass('cur') } else { obj2.eq(i).stop().fadeIn(500).siblings().stop().fadeOut(0) } }) }
//å“应å¼æ‰§è¡Œjs
var windw = $(window).width();
if (windw < 1024) {
banner('.m-bann');
$('.headnavitem .name').click(function () {
$(this).toggleClass('cur');
$(this).siblings('.navchilditems').slideToggle(500)
$(this).closest('.headnavitem').siblings().find('.navchilditems').slideUp(500)
$(this).closest('.headnavitem').siblings().find('.name').removeClass('cur');
})
$('.footmaplist .name').click(function () {
$(this).closest('.footmaplist').toggleClass('cur').siblings().removeClass('cur')
$(this).siblings('.childbox').slideToggle(500)
$(this).closest('.footmaplist').siblings().find('.childbox').slideUp(500)
})
//å页é¢å级导航展开事件
$('[pagenavclick]').on('click', function () {
if ($(this).siblings('[showbox]').length == 1) $(this).toggleClass('cur').siblings('[showbox]').slideToggle(200);
})
$('.wapbtnbox').click(function () {
$(this).toggleClass('cur');
$('.navleft,html,body').toggleClass('cur');
$('')
})
$('.navitemname').click(function () {
$(this).toggleClass('cur').siblings('.navchildbox').slideToggle(400);
$(this).closest('.navitem').siblings().find('.navitemname').removeClass('cur').siblings('.navchildbox').slideUp(400)
})
$('.wapscrolltop').click(function () {
$('html, body').stop().animate({ scrollTop: 0 }, 500)
})
$('.headlantop').click(function () {
$(this).closest('.wapheadlan').toggleClass('cur')
})
$('.footfriendtop').click(function () {
$(this).closest('.footfriend').toggleClass('cur')
})
$('.siteclustetop').click(function () {
$('.sitecluste').toggleClass('cur');
if ($('.searchbox').hasClass('cur')) {
$('.searchbox').removeClass('cur');
}
})
var curimg = $('.homesolnavlist.cur .icon').attr('curimgsrc');
$('.homesolnavlist.cur .icon').css({ 'background-image': 'url(' + curimg + ')' })
$('.homesolnavlist').click(function () {
var i = $(this).index(),
curimg = $(this).find('.icon').attr('curimgsrc');
$(this).addClass('cur').siblings().removeClass('cur');
$(this).find('.icon').css({ 'background-image': 'url(' + curimg + ')' });
$(this).siblings().each(function () {
var sibimgsc = $(this).find('.icon').attr('imgsrc');
$(this).find('.icon').css({ 'background-image': 'url(' + sibimgsc + ')' });
})
$('.homesollistimg').eq(i).addClass('cur').siblings().removeClass('cur');
$('.homesollist').eq(i).addClass('cur').siblings().removeClass('cur');
})
} else {
function detectZoom () {
var ratio = 0,
screen = window.screen,
ua = navigator.userAgent.toLowerCase();
if (window.devicePixelRatio !== undefined) {
ratio = window.devicePixelRatio
} else if (~ua.indexOf('msie')) {
if (screen.deviceXDPI && screen.logicalXDPI) ratio = screen.deviceXDPI / screen.logicalXDPI;
} else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
ratio = window.outerWidth / window.innerWidth;
}
if (ratio) ratio = Math.round(ratio * 100);
return ratio;
};
isScale();
$(window).on('resize', function () { isScale() });
//判æ–PC端æµè§ˆå™¨ç¼©æ”¾æ¯”例ä¸æ˜¯100%时的情况
function isScale () {
var rate = detectZoom();
//if(rate != 100) alert('当å‰é¡µé¢ä¸æ˜¯æ ‡å‡†100%显示,为防æ¢æµè§ˆå™¨å‡ºé”™ï¼Œè¯·æŒ‰é”®ç›˜ctrl+0æ¢å¤100%æ˜¾ç¤ºæ ‡å‡†ï¼');
}
banner('.pcbanner');
$(window).scroll(function () {
var t = $(this).scrollTop();
if (t >= $('[allbanner]').height()) {
$('.scrolltop, .consulbox').addClass('cur');
} else {
$('.scrolltop, .consulbox').removeClass('cur')
}
})
$('.scrolltop').click(function () {
$('html, body').stop().animate({ scrollTop: 0 }, 1000)
})
$('.homesolnavlist').mouseenter(function () {
$('.homesollist').eq($(this).index()).addClass('cur').siblings().removeClass('cur')
})
togglediv($('.homesolnavlist'), $('.homesollist'), "1");
if ($('.home2box').length > 0) {
$('.home2box .list').eq(0).css({ 'width': '566px' });
var home2boxw = parseFloat($('.home2box').width().toFixed(2));
home2boxw2 = parseFloat(((home2boxw - 566 - 15) / 3).toFixed(2));
$('.home2box .list').mouseenter(function () {
$(this).addClass('cur').siblings().removeClass('cur');
$(this).siblings().stop().animate({ 'width': home2boxw2 }, 500, 'linear')
$(this).stop().animate({ 'width': '566px' }, 500, 'linear')
})
}
$(window).resize(function () {
var home2boxw_b = $('.home2box').width(),
home2boxw_b = (home2boxw_b - 566 - 15) / 3;
$('.home2box .list').each(function () {
var w = $(this).width();
if (w == 566) {
$(this).width(w);
} else {
$(this).css({ 'width': home2boxw_b })
}
})
})
}
$('.searchbtn').click(function () {
$('.searchbox').slideToggle(500).toggleClass('cur');
})
$('.searchbox .close').click(function () {
$('.searchbox').slideUp(500).removeClass('cur');
})
function makesvg (percentage) {
var abs_percentage = Math.abs(percentage).toString();
var percentage_str = percentage.toString();
var svg = '';
return svg
}
function banner (obj, s) {
var banswiper = new Swiper('' + obj + '', {
// speed: 1000,
effect: 'fade',
autoplay: {
delay: 6000,
disableOnInteraction: false
},
pagination: {
el: '' + obj + ' .swiper-pagination',
clickable: true
},
navigation: {
nextEl: '' + obj + ' .swiper-button-next',
prevEl: '' + obj + ' .swiper-button-prev',
},
on: {
init: function () {
var i = this.activeIndex;
$('' + obj + ' .swiper-slide').eq(i).find('.textbox').addClass('cur');
setTimeout(function () {
$('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet').append('');
var p = $('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet .circlechart').attr('data-percentage');
$('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet .circlechart').html(makesvg(p))
$('.indexban').find('.swiper-pagination').find('.swiper-pagination-bullet').eq(0).addClass('one')
}, 500)
},
slideChangeTransitionEnd: function () {
var i = this.activeIndex;
$('' + obj + ' .swiper-slide').eq(i).find('.textbox').addClass('cur');
$('' + obj + ' .swiper-slide').eq(i).siblings().find('.textbox').removeClass('cur');
}
}
})
}
$('.ibvideobox .playerbox').click(function () {
var vsrc = $(this).closest('.ibvideobox').attr('vsrc');
$(this).closest('.ibvideobox').find('video').attr('src', '')
if ($(this).closest('.ibvideobox').find('video').attr('src') == "") {
$(this).closest('.ibvideobox').find('video').attr('src', vsrc);
$(this).closest('.ibvideobox').addClass('cur');
// $(this).closest('.ibvideobox').find('video')[0].load();
var playPromise = $(this).closest('.ibvideobox').find('video')[0].play()
$(this).closest('.ibvideobox').find('video')[0].webkitRequestFullScreen();
if (playPromise !== undefined) {
playPromise.then(function () {
$(this).closest('.ibvideobox').find('video')[0].play()
$(this).closest('.ibvideobox').find('video')[0].webkitRequestFullScreen();
}).catch(function () {
})
}
}
})
$('[pagenavlist]').click(function () {
var id = $(this).data('id');
itop = $('[pagenavitem][id="' + id + '"]').offset().top;
$('body,html').animate({ scrollTop: itop }, 1000)
})
function aboutfun () {
var ab4swiper = new Swiper('.about4bot .swiper-container', {
slidesPerView: 2.2,
spaceBetween: 30,
speed: 1000,
navigation: {
nextEl: '.about4btnbox .swiper-button-next',
prevEl: '.about4btnbox .swiper-button-prev',
},
breakpoints: {
768: {
slidesPerView: 1.3,
spaceBetween: 20,
},
}
});
if (windw <= 1024) {
var ab5swiper = new Swiper('.about5bot .swiper-container', {
slidesPerView: 1,
spaceBetween: 0,
speed: 1000,
pagination: {
el: '.about5bot .swiper-pagination',
clickable: true,
},
});
}
var ab6swiper = new Swiper('.about6bot .swiper-container', {
slidesPerView: 3.5,
spaceBetween: 40,
speed: 1000,
navigation: {
nextEl: '.about6btnbox .swiper-button-next',
prevEl: '.about6btnbox .swiper-button-prev',
},
breakpoints: {
768: {
slidesPerView: 1.5,
spaceBetween: 20,
},
1024: {
slidesPerView: 2.5,
},
}
});
}
aboutfun()
function qualfun () {
var qual4swiper = new Swiper('.qual4slide .swiper-container', {
slidesPerView: 4,
spaceBetween: 50,
slidesPerGroup: 1,
speed: 1000,
navigation: {
nextEl: '.qual4slide .swiper-button-next',
prevEl: '.qual4slide .swiper-button-prev',
},
breakpoints: {
768: {
slidesPerView: 1,
spaceBetween: 0,
},
1024: {
slidesPerView: 3,
spaceBetween: 35,
},
}
});
var wdata = "";
if (windw >= 1440) {
wdata = 180;
} else if (windw >= 1024 && windw <= 1339) {
wdata = 230;
}
var qual5swiper = new Swiper('.qual5slide .swiper-container', {
watchSlidesProgress: true,
slidesPerView: 'auto',
spaceBetween: 0,
centeredSlides: true,
loop: true,
navigation: {
nextEl: '.qual5slide .swiper-button-next',
prevEl: '.qual5slide .swiper-button-prev',
},
pagination: {
el: '.qual5slide .swiper-pagination',
clickable: true,
},
on: {
progress: function (progress) {
if (windw >= 1024) {
for (i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i);
var slideProgress = this.slides[i].progress;
modify = 1;
if (Math.abs(slideProgress) > 1) {
modify = (Math.abs(slideProgress) - 1) * 0.3 + 1;
}
translate = slideProgress * modify * wdata + 'px';
scale = 1 - Math.abs(slideProgress) / 4;
zIndex = 999 - Math.abs(Math.round(10 * slideProgress));
slide.transform('translateX(' + translate + ') scale(' + scale + ')');
slide.css('zIndex', zIndex);
slide.css('opacity', 1);
if (Math.abs(slideProgress) > 3) {
slide.css('opacity', 0);
}
}
}
},
setTransition: function (transition) {
if (windw >= 1024) {
for (var i = 0; i < this.slides.length; i++) {
var slide = this.slides.eq(i)
slide.transition(transition);
}
}
}
},
breakpoints: {
1024: {
// slidesPerView: 3,
// spaceBetween: 35,
},
}
})
}
qualfun();
function markfun () {
var mark2swiper = new Swiper('.mark2netslide .swiper-container', {
navigation: {
nextEl: '.mark2btnbox .swiper-button-next',
prevEl: '.mark2btnbox .swiper-button-prev',
}
});
}
markfun();
function socfun () {
var soc1swiper = new Swiper('.socresp1slide .swiper-container', {
slidesPerView: 4,
navigation: {
nextEl: '.socresp1slide .swiper-button-next',
prevEl: '.socresp1slide .swiper-button-prev',
},
breakpoints: {
1024: {
slidesPerView: 1,
},
}
});
}
socfun();
function prodet () {
var prodet2swiper = new Swiper('.prodet2slide .swiper-container', {
slidesPerView: 3,
spaceBetween: 100,
navigation: {
nextEl: '.prodet2slide .swiper-button-next',
prevEl: '.prodet2slide .swiper-button-prev',
},
breakpoints: {
768: {
slidesPerView: 1,
},
1024: {
slidesPerView: 2,
spaceBetween: 50,
},
1440: {
spaceBetween: 70,
},
}
});
var num = 0;
if (windw >= 1024) {
num = 5;
} else {
num = 2;
}
var pd3l = $('.prodet3list').length,
mul = parseInt(pd3l / num),
omul = pd3l - mul * num;
if (pd3l % num == 0) {
$('.prodet3list').last().addClass('last');
if (num == 5) {
$('.prodet3list').eq($('.prodet3list').last().index() - 1).addClass('last');
$('.prodet3list').eq($('.prodet3list').last().index() - 2).addClass('last');
$('.prodet3list').eq($('.prodet3list').last().index() - 3).addClass('last');
$('.prodet3list').eq($('.prodet3list').last().index() - 4).addClass('last')
} else {
$('.prodet3list').eq($('.prodet3list').last().index() - 1).addClass('last');
}
} else {
for (var o = 0; o < digitize(omul).length; o++) {
$('.prodet3list').eq($('.prodet3list').last().index() - digitize(omul)[o]).addClass('last');
}
}
function digitize (n) {
var arr = [];
for (var i = 0; i < n; i++) { arr.push(i); }
return arr;
}
togglediv($('.prodet5navlist'), $('.prodet5botlist'), "1");
}
prodet();
function video () {
$('.video').on('click', '.proitem .play', function () {
var vsrc = $(this).closest('.proitem').attr('vsrc');
// $(this).closest('.proitem').find('video').attr('src', '');
if ($(this).closest('.proitem').find('video').attr('src') == "") {
$(this).closest('.proitem').find('video').attr('src', vsrc);
$(this).closest('.proitem').addClass('cur').siblings().removeClass('cur').find('video')[0].pause();
// $(this).closest('.ibvideobox').find('video')[0].load();
var playPromise = $(this).closest('.proitem').find('video')[0].play()
// $(this).closest('.proitem').find('video')[0].webkitRequestFullScreen();
if (playPromise !== undefined) {
playPromise.then(function () {
// $(this).closest('.proitem').find('video')[0].play()
// $(this).closest('.proitem').find('video')[0].webkitRequestFullScreen();
}).catch(function () {
})
}
}
})
}
video();
})