$(function(){
/* $('.ipt_s1[name="type"]').on('change', function() {
var sid = $(this).val();
console.log(sid)
$('.ipt_s1[name="typeb"]').find('option:not(:first)').hide();
$('.ipt_s1[name="typeb"]').find('option[data-pid="'+sid+'"]').show();
});
$('.ipt_s1[name="typeb"]').find('option:not(:first)').hide(); */
var videoAD = $(".videoAD");
var myVideo = $("#myVideo");
myVideo.on("ended", function () {
videoAD.fadeOut(1000,function(){
videoAD.remove();
});
});
$('.videoClose').click(function(){
videoAD.fadeOut(1000,function(){
videoAD.remove();
});
})
/*if($(window).width() <= 1024){
videoAD.remove();
}*/
var ua = navigator.userAgent.toLowerCase();
/*鍦ㄥ井淇℃垨鑰呯櫨搴︿腑鎵撳紑*/
if (ua.match(/micromessenger/i) !== null || ua.match(/baiduboxapp/i) !== null) {
videoAD.remove();
}
$('.pNavList').addClass('pNavList'+$('.pNavList li').length);
$('.pNavList li.curr').addClass('active').siblings().removeClass('active');
$('.pNavList li').mouseenter(function(){
$(this).addClass('active').siblings().removeClass('active');
}).mouseleave(function(){
$('.pNavList li.curr').addClass('active').siblings().removeClass('active');
})
/*浜у搧鍒嗗壊瀛楃涓?/
var inputString = $('.tit5 em').text();
var result = wrapCharactersWithSpanES5(inputString);
$('.tit5 em').html(result);
$('.proTj .t').click(function(){
$('.proTj .c').slideToggle();
})
/*瑙嗛*/
$(".play_btn").click(function() {
var dataVideo = $(this).attr("data-video");
var poster = $(this).attr("data-img");
$("body").append(
'
');
$(".video_bg,.video_box").fadeIn();
});
$(document).on('click','.video_box i',function(){
$(".video_bg,.video_box").fadeOut(500, function() { $(".video_bg,.video_box").remove(); });
});
$(document).on('click','.video_bg',function(){
$(".video_bg,.video_box").fadeOut(500, function() { $(".video_bg,.video_box").remove(); });
});
var iBanner = new Swiper('.iBanner .swiper', {
paginationClickable: true,
effect: 'fade',
speed:800,
loop:true,
autoplay: {
delay: 5800,
disableOnInteraction: false,
},
pagination: {
el: '.iBanner .swiperDots',
clickable: true,
},
navigation: {
nextEl: '.iBanner .swiperNext',
prevEl: '.iBanner .swiperPrev',
},
on: {
slideChange: function () {
//console.log('鏃? ' + this.previousIndex,'褰撳墠椤电爜: ' + this.realIndex);
$('.iBanner .swiperPage strong').text(this.realIndex+1);
}
}
});
var sLenth=$('.iBanner .swiperDots span').length;
$('.iBanner .swiperPage span').text(sLenth);
var iPro = new Swiper('.iPro .swiper', {
paginationClickable: true,
//centeredSlides: true,
loop:true,
speed:800,
pagination: {
el: '.iPro .swiperDots',
clickable: true,
},
navigation: {
nextEl: '.iPro .swiperNext',
prevEl: '.iPro .swiperPrev',
},
breakpoints: {
980: {
slidesPerView: 2
},
641: {
slidesPerView: 2
},
241: {
slidesPerView: 1
}
}
});
var caseListC = new Swiper('.caseListC .swiper', {
paginationClickable: true,
//centeredSlides: true,
loop:true,
speed:800,
pagination: {
el: '.caseListC .swiperDots',
clickable: true,
},
navigation: {
nextEl: '.caseListC .swiperNext',
prevEl: '.caseListC .swiperPrev',
},
breakpoints: {
980: {
slidesPerView: 2,
slidesPerGroup: 2
},
641: {
slidesPerView: 2,
slidesPerGroup: 2
},
241: {
slidesPerView: 1,
slidesPerGroup: 1
}
}
});
var iNews = new Swiper('.iNews .swiper', {
paginationClickable: true,
loop:true,
speed:800,
pagination: {
el: '.iNews .swiperDots',
clickable: true,
},
navigation: {
nextEl: '.iNews .swiperNext',
prevEl: '.iNews .swiperPrev',
},
breakpoints: {
980: {
slidesPerView: 3,
slidesPerGroup: 3
},
641: {
slidesPerView: 2,
slidesPerGroup: 2
},
241: {
slidesPerView: 1,
slidesPerGroup: 1
}
}
});
var caseListA = new Swiper('.caseListA .swiper', {
paginationClickable: true,
loop:true,
speed:800,
pagination: {
el: '.caseListA .swiperDots',
clickable: true,
},
navigation: {
nextEl: '.caseListA .swiperNext',
prevEl: '.caseListA .swiperPrev',
},
breakpoints: {
1025: {
slidesPerView: 4,
slidesPerGroup: 4
},
981: {
slidesPerView: 3,
slidesPerGroup: 3
},
641: {
slidesPerView: 2,
slidesPerGroup: 2
},
241: {
slidesPerView: 1,
slidesPerGroup: 1
}
}
});
var honorListA = new Swiper('.honorListA .swiper', {
paginationClickable: true,
loop:true,
speed:800,
pagination: {
el: '.honorListA .swiperDots',
clickable: true,
},
navigation: {
nextEl: '.honorListA .swiperNext',
prevEl: '.honorListA .swiperPrev',
},
breakpoints: {
980: {
slidesPerView: 5,
slidesPerGroup: 5
},
641: {
slidesPerView: 3,
slidesPerGroup: 3
},
241: {
slidesPerView: 2,
slidesPerGroup: 2
}
}
});
$('[rel="example_group1"]').fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'speedIn' : 600,
'speedOut' : 200,
'overlayShow' : false
});
$('.tSearch .i').click(function(){
if(!$(this).parents('.tSearch').hasClass('active')){
$(this).parents('.tSearch').addClass('active');
$(this).parents('.tSearch').find('.box').slideDown();
$('.menu,.tLanguage').removeClass('active');
$('.tLanguage .box').removeAttr('style');
}else{
$(this).parents('.tSearch').removeClass('active');
$(this).parents('.tSearch').find('.box').slideUp();
}
});
$('.tLanguage').click(function(){
if(!$(this).hasClass('active')){
$(this).addClass('active');
$('.ignore').fadeIn();
$('.menu,.tSearch').removeClass('active');
$('.tSearch .box').removeAttr('style');
}else{
$(this).removeClass('active');
$('.ignore').fadeOut();
}
});
$('.ignoreList li a').click(function(){
$('.tLanguage').removeClass('active');
$('.ignore').fadeOut();
})
$('.ignoreList .i').click(function(){
$('.ignore').fadeOut();
$('.tLanguage').removeClass('active');
});
$('.menu-link').click(function(){
if(!$(this).hasClass('active')){
$('.menu-link').addClass('active');
$('.menu').addClass('active');
$('.tSearch,.tLanguage').removeClass('active');
$('.tSearch .box,.tLanguage .box').removeAttr('style');
}else{
$('.menu-link').removeClass('active');
$('.menu').removeClass('active');
}
});
$('.menu li').click(function(){
if($(window).width()<=1024){
$(this).addClass('curr').siblings().removeClass('curr');
$(this).siblings().find('span').removeClass('active');
$(this).siblings().find('.box').slideUp();
}
});
$('.menu li .h3 span').click(function(){
if($(window).width()<=1024){
$(this).toggleClass('active');
$(this).parents('.h3').siblings(".box").slideToggle();
}
});
$('.show_sq').click(function(event){
event.stopPropagation();
$('.nb-icon-wrap').click();
return false;
});
$('.back_top,.backTop').click(function(){
$('html,body').animate({scrollTop:0},120);
});
$('.pageNext').click(function(){
$('html,body').animate({scrollTop:$(window).height()-$('.header').height()},500);
});
$(window).scroll(function(){
bodyFixb();
$('.menu-link').removeClass('active');
$('.menu').removeClass('active');
});
$(window).resize(function(){
});
$('body').addClass('body_ready');
/*function bodyFix(){
if($(window).scrollTop()>50){
$('body').addClass('body_fix');
}else{
$('body').removeClass('body_fix');
}
}
bodyFix();*/
var inTop = 0;
function bodyFixb(){
if($(window).width()>1024){
var setTop = $(window).scrollTop();
if(setTop>50){
$('body').addClass('body_fix');
}else{
$('body').removeClass('body_fix');
}
if(setTop>inTop && setTop>200){
$('body').addClass('body_hide');
}else{
$('body').removeClass('body_hide');
}
inTop = setTop;
}
}
bodyFixb();
$('.swiperDots').each(function() {
if($(this).find('span').length<=1){
$(this).hide();
}
});
$('.infoAcon>p').attr('data-josh-anim-name','fadeIn');
/*椤甸潰婊戝姩鍔ㄧ敾*/
if($('[data-josh-anim-name]').length>0){
var josh = new Josh({
initClass: "[data-josh-anim-name]",
animateInMobile: true,
offset: 0.3,
onDOMChange: false
});
}
// 鍋囪浣犵殑鍏冪礌鏈夌壒瀹氱殑绫诲悕锛屼緥濡 ".watched-element"
if($('[data-number-plus]').length>0){
$('[data-number-plus]').each(function() {
var $this = $(this);
var elementOffsetTop = $this.offset().top;
$(window).scroll(function() {
ifscroll($this,elementOffsetTop)
});
if($(window).width()<1025){
ifscroll($this,elementOffsetTop)
}
});
}
function ifscroll($element,elementOffsetTop){
var $this = $element;
var windowHeight = $(window).height();
var windowScrollTop = $(window).scrollTop();
// 璁$畻鍏冪礌鏄惁鍦ㄥ彲瑙嗗尯鍩
var elementVisible = (elementOffsetTop - windowScrollTop) < windowHeight;
if (elementVisible && !$this.data('triggered')) { // 娣诲姞鏁版嵁灞炴€ч伩鍏嶉噸澶嶈Е鍙
// 鍏冪礌棣栨杩涘叆鍙鍖哄煙锛屾墽琛岀浉鍏虫搷浣
executeElementFunction($this);
// 璁剧疆鏁版嵁灞炴€ц〃绀哄凡瑙﹀彂
$this.data('triggered', true);
}
}
function executeElementFunction($element) {
//console.log("鍏冪礌鍦ㄥ彲瑙嗗尯鍩熷唴锛屾墽琛屾搷浣?..");
var $this = $element;
var next = 0;
var intNumberplus = setInterval(function (){
var data = $this.data("number-plus").split(","),
start = data[0],
end = data[1],
s = data[2],
avg = (end - start) / (s * 100);
next = next + avg;
if (next >= end) {
next = end;
clearInterval(intNumberplus);
}
$this.html(Math.ceil(next));
}, 20);
// 鏍规嵁$element鎵ц鐩稿簲鐨勬搷浣滐紝$element鏄褰撳墠鍙鍏冪礌鐨勫紩鐢
// 渚嬪锛?element.css('color', 'red');
}
// 鑷畾涔夋潯浠跺嚱鏁帮紝鍐冲畾鏄惁閲嶇疆瑙﹀彂鏍囪锛岄粯璁ゆ€绘槸閲嶇疆锛屼綘鍙互鏍规嵁闇€瑕佽皟鏁撮€昏緫
function shouldResetTrigger($element) {
// 绀轰緥锛氬綋鍏冪礌瀹屽叏绂诲紑鍙鍖哄煙鏃堕噸缃
// 杩欓噷绠€鍖栧鐞嗭紝瀹為檯鎯呭喌鍙兘闇€瑕佹洿澶嶆潅鐨勯€昏緫鏉ュ垽鏂槸鍚﹀畬鍏ㄧ寮€鍙鍖哄煙
var elementBottom = $element.offset().top + $element.outerHeight();
var viewportBottom = $(window).scrollTop() + $(window).height();
return elementBottom < viewportBottom;
}
var likeid = location.hash.substring(1);
if(likeid!="pic"){
$('body').addClass('noSelect');
//璁剧疆鍙抽敭浜嬩欢
//alert('绂佹鍙抽敭鑿滃崟!');
function noMenuOne() {
return false;
}
//绂佹F12
document.oncontextmenu = noMenuOne;
document.onkeydown = function () {
if (window.event && window.event.keyCode == 123) {
event.keyCode = 0;
event.returnValue = false;
return false;
}
};
/*document.getElementById('noVideo').oncontextmenu = function() {
return false;
};*/
$('img').each(function() {
// 涓哄綋鍓嶅浘鐗囧垱寤轰竴涓柊鐨凕div>鍏冪礌锛屽苟璧嬩簣涓€涓被鍚
var newDiv = $('');
// 灏嗗綋鍓嶅浘鐗囩Щ鍔ㄥ埌鏂板垱寤虹殑
涓
$(this).wrap(newDiv);
//$(this).wrap(newDiv);
});
if (location.protocol === 'file:') {
//console.log('褰撳墠鐜锛氭湰鍦癏TML鏂囦欢');
$('.nodownimg').append('

')
} else if (location.protocol === 'http:' || location.protocol === 'https:') {
//console.log('褰撳墠鐜锛氱嚎涓婄幆澧?);
$('.nodownimg').append('

')
} else {
//console.log('褰撳墠鐜锛氬叾浠栫幆澧?);
$('.nodownimg').append('
')
}
}else{
$('a').each(function() {
// 浣跨敤 attr 鏂规硶鑾峰彇鍜岃缃 href 灞炴€
var $link = $(this);
var currentHref = $link.attr('href');
// 纭繚 href 瀛樺湪涓斾笉鏄┖瀛楃涓
if (currentHref) {
// 濡傛灉 href 涓嶆槸浠 #pic 缁撳熬锛屽垯杩藉姞 #pic
if (!currentHref.endsWith('#pic')) {
$link.attr('href', currentHref + '#pic');
}
}
});
}
});
/*鍒嗗壊瀛楃涓?/
function wrapCharactersWithSpanES5(str) {
var parts = str.split('-');
var wrappedParts = [];
for (var i = 0; i < parts.length; i++) {
wrappedParts.push('' + parts[i] + '');
}
return wrappedParts.join('-');
}