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) } }) }
//鍝嶅簲寮忔墽琛宩s
var windw = $(window).width();
if (windw < 1024) {
// banner('.m-bann');
banner('.pcbanner');
$('.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').toggleClass('cur');
$('.head').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)
})
$('.logintop').click(function () {
$(this).closest('.login').toggleClass('cur')
})
$('.footfriendtop').click(function () {
$(this).closest('.footfriend').toggleClass('cur')
})
function procert() {
var bw = 0
$('.prodcnavlist').each(function () {
bw += $(this).outerWidth();
})
$('.prodcnav .box').css({ 'width': bw })
}
if ($('.prodcnavlist')[0]) {
procert()
}
$('.headtelbox').click(function () {
$(this).toggleClass('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').addClass('cur')
} else {
$('.scrolltop').removeClass('cur')
}
})
$('.scrolltop').click(function () {
$('html, body').stop().animate({ scrollTop: 0 }, 1000)
})
}
$('.searchbtn').click(function () {
$('.searchbox').toggleClass('cur');
$('.head .box').toggleClass('cur');
// $('.head').toggleClass('cur');
$('#searchval').focus();
})
$('.searchbox .close').click(function () {
$('.searchbox').removeClass('cur');
$('.head .box').removeClass('cur');
// $('.head').removeClass('cur');
$('#searchval').blur()
})
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,
autoplay: {
delay: 6000,
disableOnInteraction: false
},
effect: 'fade',
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');
}
}
})
}
$('.recruititem').each(function () {
var h = $(this).find('.bigbox').height();
$(this).find('.textbox').css('max-height', h)
})
$('.recruititem .more').click(function () {
if (windw > 1014) {
$(this).closest('.recruititem').toggleClass('cur');
$(this).closest('.recruititem').siblings().addClass('cur')
} else {
$(this).closest('.recruititem').toggleClass('cur')
$(this).closest('.recruititem').siblings().addClass('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 () {
})
}
}
})
var honswiper = new Swiper('.honslide .swiper-container', {
slidesPerView: 4,
spaceBetween: 60,
slidesPerGroup: 1,
pagination: {
el: '.honslide .swiper-pagination',
clickable: true,
},
navigation: {
nextEl: '.honslide .swiper-button-next',
prevEl: '.honslide .swiper-button-prev',
},
breakpoints: {
1024: {
slidesPerView: 1,
spaceBetween: 50,
},
1440: {
slidesPerView: 3,
spaceBetween: 30,
},
}
});
var swiper = new Swiper('.magaz2topslide .swiper-container', {
slidesPerView: 5,
navigation: {
nextEl: '.magaz2topslide .swiper-button-next',
prevEl: '.magaz2topslide .swiper-button-prev',
},
breakpoints: {
1024: {
slidesPerView: 2,
},
1440: {
slidesPerView: 3,
},
}
});
togglediv($(".homepronavlist"), $('.homeproitem'), "1");
function homeinv() {
$('.homeinvlist').mouseenter(function () {
$(this).addClass('cur').siblings().removeClass('cur');
$(this).stop().animate({ 'width': '50%' }, 500).siblings().stop().animate({ 'width': '25%' }, 500)
})
}
if (windw) homeinv();
function inv() {
$('.invseltop').click(function () {
$(this).closest('.invsel').toggleClass('cur');
$(this).closest('.item').siblings().find('.invsel').removeClass('cur');
})
}
inv()
})