$(function () {
$(window).scroll(function () {
var scrollPos = $(window).scrollTop();
$('.anchorpoint').each(function (i) {
var thisPos = $(this).offset().top - 300;
if (scrollPos >= thisPos) {
setTimeout(function () {
$('.anchorpoint').eq(i).removeClass('video-lazyload');
if (i == 0) {
$('.video_player').trigger('click');
}
if (i == 1) {
$('.video_player2').trigger('click');
}
}, 1200);
}
});
});
$(document).on('click', '.swiper-pagination02 span:nth-child(4)', function () {
$('.video_player3').trigger('click');
});
// var images = $('.lazyload')
// function callback(entries) {
// for (let i of entries) {
// if (i.isIntersecting) {
// let img = i.target
// let trueSrc = img.getAttribute('data-src')
// img.setAttribute('src', trueSrc)
// img.addEventListener('load', function () {
// setTimeout(function () {
// img.classList.remove('lazyload')
// }, 1200)
// })
// observer.unobserve(img)
// }
// }
// }
// const observer = new IntersectionObserver(callback)
// for (let i of images) {
// observer.observe(i)
// }
setTimeout(function () {
$('.ias-ads-kvtxt').removeClass('lazyload');
}, 1230);
// 生态 1
var mySwiper = new Swiper('.as-tpl-hm-banner4', {
// direction: "vertical",
loop: false,
pagination: {
el: '.swiper-pagination4',
clickable: true,
renderBullet: function (index, className) {
switch (index) {
case 0:
text = '代客洗车';
break;
case 1:
text = '预约充电';
break;
case 2:
text = '人工代充代洗';
break;
case 3:
text = '便捷缴费';
break;
}
return (
// '' + text + "";
'' +
text +
''
);
},
},
navigation: {
nextEl: '.swiper-button-next4',
prevEl: '.swiper-button-prev4',
},
slidesPerView: 1,
speed: 500,
loop: false,
autoplay: false,
spaceBetween: 4,
keyboard: true,
observer: true,
observeParents: true,
on: {
transitionStart: function (mySwiper) {
var sliderwidth = $('.ias-tpl-hm-section03-4 .swiper-pagination-bullet').width();
var allwidth = sliderwidth * this.activeIndex;
var wd = allwidth + 'px';
$('.ias-tpl-hm-section03-4 .ias-tpl-hm-tool .ias-tpl-pagination-bg').css('left', wd);
$('.as-tpl-hm-banner4').find('img').trigger('appear');
},
slideChangeTransitionEnd: function () {
gatabswiper(this);
},
},
});
// 安全升级轮播 1
var mySwiper = new Swiper('.as-tpl-hm-banner01', {
// direction: "vertical",
loop: false,
pagination: {
el: '.swiper-pagination01',
clickable: true,
renderBullet: function (index, className) {
switch (index) {
case 0:
text = '全时速';
break;
case 1:
text = '全方向';
break;
case 2:
text = '全目标';
break;
case 3:
text = '全天候';
break;
case 5:
text = '';
break;
}
return (
// '' + text + "";
'' +
text +
''
);
},
},
navigation: {
nextEl: '.swiper-button-next01',
prevEl: '.swiper-button-prev01',
},
slidesPerView: 1,
speed: 500,
loop: false,
autoplay: false,
spaceBetween: 4,
keyboard: true,
observer: true,
observeParents: true,
on: {
transitionStart: function (mySwiper) {
var sliderwidth = $('.ias-tpl-hm-section03-01 .swiper-pagination-bullet').width();
var allwidth = sliderwidth * this.activeIndex;
var wd = allwidth + 'px';
$('.ias-tpl-hm-section03-01 .ias-tpl-hm-tool .ias-tpl-pagination-bg').css('left', wd);
$('.as-tpl-hm-banner01').find('img').trigger('appear');
},
slideChangeTransitionEnd: function () {
gatabswiper(this);
},
},
});
// 安全升级轮播 2
var mySwiper2 = new Swiper('.as-tpl-hm-banner02', {
loop: false,
pagination: {
el: '.swiper-pagination02',
clickable: true,
renderBullet: function (index, className) {
switch (index) {
case 0:
text = '路面自适应 AEB';
break;
case 1:
text = '爆胎稳定控制辅助';
break;
case 2:
text = '驾驶员失能辅助';
break;
case 3:
text = '哨兵模式增强';
break;
case 4:
text = '防误踩加速踏板';
break;
}
return (
// '' + text + "";
'' +
text +
''
);
},
},
navigation: {
nextEl: '.swiper-button-next02',
prevEl: '.swiper-button-prev02',
},
slidesPerView: 1,
loop: false,
autoplay: false,
spaceBetween: 4,
keyboard: true,
observer: true,
observeParents: true,
on: {
transitionStart: function (mySwiper2) {
var sliderwidth = $('.ias-tpl-hm-section03-02 .swiper-pagination-bullet').width();
var allwidth = sliderwidth * this.activeIndex;
var wd = allwidth + 'px';
$('.ias-tpl-hm-section03-02 .ias-tpl-hm-tool .ias-tpl-pagination-bg').css('left', wd);
$('.as-tpl-hm-banner02').find('img').trigger('appear');
if ($('.as-tpl-hm-banner02 .swiper-slide4').hasClass('swiper-slide-active')) {
$('.video_player3').trigger('click');
}
},
slideChangeTransitionEnd: function () {
gatabswiper(this);
},
},
});
// 体验升级 1
var mySwiper2 = new Swiper('.as-tpl-hm-banner03', {
loop: false,
pagination: {
el: '.swiper-pagination03',
clickable: true,
renderBullet: function (index, className) {
switch (index) {
case 0:
text = '车位到车位';
break;
case 1:
text = '智能通过闸机';
break;
case 2:
text = '环岛通行无忧';
break;
case 3:
text = '跟车更平稳';
break;
}
return (
// '' + text + "";
'' +
text +
''
);
},
},
navigation: {
nextEl: '.swiper-button-next03',
prevEl: '.swiper-button-prev03',
},
slidesPerView: 1,
loop: false,
autoplay: false,
spaceBetween: 4,
keyboard: true,
observer: true,
observeParents: true,
on: {
transitionStart: function (mySwiper2) {
var sliderwidth = $('.ias-tpl-hm-section03-03 .swiper-pagination-bullet').width();
var allwidth = sliderwidth * this.activeIndex;
var wd = allwidth + 'px';
$('.ias-tpl-hm-section03-03 .ias-tpl-hm-tool .ias-tpl-pagination-bg').css('left', wd);
$('.as-tpl-hm-banner03').find('img').trigger('appear');
},
slideChangeTransitionEnd: function () {
gatabswiper(this);
},
},
});
// 体验升级 1
var mySwiper2 = new Swiper('.as-tpl-hm-banner04', {
loop: false,
pagination: {
el: '.swiper-pagination04',
clickable: true,
renderBullet: function (index, className) {
switch (index) {
case 0:
text = '离车泊入辅助';
break;
case 1:
text = '一键挪车';
break;
case 2:
text = '极窄车位';
break;
}
return (
// '' + text + "";
'' +
text +
''
);
},
},
navigation: {
nextEl: '.swiper-button-next04',
prevEl: '.swiper-button-prev04',
},
slidesPerView: 1,
loop: false,
autoplay: false,
spaceBetween: 4,
keyboard: true,
observer: true,
observeParents: true,
on: {
transitionStart: function (mySwiper2) {
var sliderwidth = $('.ias-tpl-hm-section03-04 .swiper-pagination-bullet').width();
var allwidth = sliderwidth * this.activeIndex;
var wd = allwidth + 'px';
$('.ias-tpl-hm-section03-04 .ias-tpl-hm-tool .ias-tpl-pagination-bg').css('left', wd);
$('.as-tpl-hm-banner04').find('img').trigger('appear');
},
slideChangeTransitionEnd: function () {
gatabswiper(this);
},
},
});
// if (screenwidth < 900) {
// $(".ias-tpl-hm-section03 .swiper-pagination .swiper-pagination-bullet").text("");
// }
// 智圆行方
// var mySwiper = new Swiper(".ias-ads-banner-banner01", {
// direction: "vertical",
// loop: false,
// pagination: {
// el: ".ads-swiper-pagination",
// type: "fraction",
// },
// navigation: {
// nextEl: ".ads-swiper-button-next",
// prevEl: ".ads-swiper-button-prev",
// },
// slidesPerView: 1.5,
// speed: 1000,
// loop: true,
// autoplay: false,
// spaceBetween: 0,
// keyboard: true,
// observer: true,
// observeParents: true,
// effect: "fade",
// cube: {
// slideShadows: true,
// shadow: true,
// shadowOffset: 100,
// shadowScale: 0.6,
// },
// // watchSlidesProgress: true,
// // slidesPerView: "auto",
// // centeredSlides: true,
// // loop: true,
// // loopedSlides: 2,
// // effect: "cards",
// // 20250110
// // grabCursor: true,
// // effect: "creative",
// // creativeEffect: {
// // prev: {
// // // shadow: true,
// // translate: [0, 0, 1],
// // // opacity: 0.2,
// // // scale: 1,
// // },
// // next: {
// // translate: [0, 0, 1],
// // // opacity: 1,
// // // scale: 2,
// // },
// // perspective: true,
// // },
// });
$('.ias-tpl-tip1').on('click', function () {
var currentPosition = $(window).scrollTop();
var top = $('.ias-tpl-hm-bm').offset().top - 60;
$('html, body').animate(
{
scrollTop: top,
},
1000
);
$('.ias-tpl-hm-bm p').removeClass('active');
$('.ias-tpl-tip01').addClass('active');
currentPositionTop = currentPosition;
return currentPositionTop;
});
$('.ias-tpl-hm-bm').on('click', '.ias-tpl-tip01.active', function () {
$('html, body').animate(
{
scrollTop: currentPositionTop,
},
1000
);
$('.ias-tpl-hm-bm p').removeClass('active');
});
// 智圆行方
var aiFeature3TextIndex = 0;
$('.ads-bionics-3-prev-btn').on('click', function () {
// if (aiFeature3Timer != 0) {
// clearInterval(aiFeature3Timer);
// aiFeature3Timer = 0;
// }
var _prevIndex = aiFeature3TextIndex;
aiFeature3TextIndex--;
if (aiFeature3TextIndex < 0) {
aiFeature3TextIndex = 1;
}
// gsap.fromTo(
// $(".ads-bionics-3-text-swiper .swiper-slide")[aiFeature3TextIndex],
// { y: "-100%" },
// { y: 0, duration: 1, ease: "power4.out" }
// );
// gsap.fromTo(
// $(".ads-bionics-3-text-swiper .swiper-slide")[_prevIndex],
// { y: 0 },
// { y: "100%", duration: 1, ease: "power4.out" }
// );
$('.ads-bionics-3-swiper-control-text-active-index').attr('data-index', aiFeature3TextIndex);
$('.ads-bionics-3-swiper .ads-bionics-3-item').each(function () {
var _index = $(this).attr('data-index');
_index++;
if (_index >= $('.ads-bionics-3-swiper .ads-bionics-3-item').length) {
_index = 0;
}
$(this).attr('data-index', _index);
});
});
$('.ads-bionics-3-next-btn').on('click', function () {
// if (aiFeature3Timer != 0) {
// clearInterval(aiFeature3Timer);
// aiFeature3Timer = 0;
// }
var _prevIndex = aiFeature3TextIndex;
aiFeature3TextIndex++;
if (aiFeature3TextIndex > 1) {
aiFeature3TextIndex = 0;
}
// gsap.fromTo(
// $(".ads-bionics-3-text-swiper .swiper-slide")[aiFeature3TextIndex],
// { y: "100%" },
// { y: 0, duration: 1, ease: "power4.out" }
// );
// gsap.fromTo(
// $(".ads-bionics-3-text-swiper .swiper-slide")[_prevIndex],
// { y: 0 },
// { y: "-100%", duration: 1, ease: "power4.out" }
// );
$('.ads-bionics-3-swiper-control-text-active-index').attr('data-index', aiFeature3TextIndex);
$('.ads-bionics-3-swiper .ads-bionics-3-item').each(function () {
var _index = $(this).attr('data-index');
_index--;
if (_index < 0) {
_index = $('.ads-bionics-3-swiper .ads-bionics-3-item').length - 1;
}
$(this).attr('data-index', _index);
});
});
// 20250329
function isMobileWeChatBrowser() {
const ua = navigator.userAgent.toLowerCase();
const isWeChat = ua.indexOf('micromessenger') !== -1; // 微信浏览器检测:ml-citation{ref="2,7" data="citationList"}
const isMobile = /android|iphone|ipad/i.test(ua); // 移动端检测:ml-citation{ref="7,8" data="citationList"}
return isWeChat && isMobile;
}
// 使用示例
if (isMobileWeChatBrowser()) {
$('.wechat-hide').hide();
$('.wechat-show').show();
} else {
$('.wechat-hide').show();
$('.wechat-show').hide();
}
const scrollButton1 = document.getElementById('wen1');
const section1 = document.getElementById('da1');
scrollButton1.addEventListener('click', () => {
section1.scrollIntoView({ block: 'center', behavior: 'smooth' });
section1.classList.add('nhov');
section2.classList.remove('nhov');
section3.classList.remove('nhov');
section4.classList.remove('nhov');
section5.classList.remove('nhov');
});
const scrollButton2 = document.getElementById('wen2');
const section2 = document.getElementById('da2');
scrollButton2.addEventListener('click', () => {
section2.scrollIntoView({ block: 'center', behavior: 'smooth' });
section2.classList.add('nhov');
section1.classList.remove('nhov');
section3.classList.remove('nhov');
section4.classList.remove('nhov');
section5.classList.remove('nhov');
});
const scrollButton3 = document.getElementById('wen3');
const section3 = document.getElementById('da3');
scrollButton3.addEventListener('click', () => {
section3.scrollIntoView({ block: 'center', behavior: 'smooth' });
section3.classList.add('nhov');
section1.classList.remove('nhov');
section2.classList.remove('nhov');
section4.classList.remove('nhov');
section5.classList.remove('nhov');
});
const scrollButton3new = document.getElementById('wen3new');
const section3new = document.getElementById('da3');
scrollButton3new.addEventListener('click', () => {
section3new.scrollIntoView({ block: 'center', behavior: 'smooth' });
section3new.classList.add('nhov');
section1.classList.remove('nhov');
section2.classList.remove('nhov');
section4.classList.remove('nhov');
section5.classList.remove('nhov');
});
const scrollButton4 = document.getElementById('wen4');
const section4 = document.getElementById('da4');
scrollButton4.addEventListener('click', () => {
section4.scrollIntoView({ block: 'center', behavior: 'smooth' });
section4.classList.add('nhov');
section1.classList.remove('nhov');
section2.classList.remove('nhov');
section3.classList.remove('nhov');
section5.classList.remove('nhov');
});
const scrollButton5 = document.getElementById('wen5');
const section5 = document.getElementById('da5');
scrollButton5.addEventListener('click', () => {
section5.scrollIntoView({ block: 'center', behavior: 'smooth' });
section5.classList.add('nhov');
section1.classList.remove('nhov');
section2.classList.remove('nhov');
section3.classList.remove('nhov');
section4.classList.remove('nhov');
});
// 20250110
// var aiFeature3Timer = 0;
// setSwiperAutoplay(".ads-bionics-3-swiper-container", function () {
// aiFeature3Timer = setInterval(function () {
// var _prevIndex = aiFeature3TextIndex;
// aiFeature3TextIndex++;
// if (aiFeature3TextIndex > 1) {
// aiFeature3TextIndex = 0;
// }
// gsap.fromTo(
// $(".ads-bionics-3-text-swiper .swiper-slide")[aiFeature3TextIndex],
// { y: "100%" },
// { y: 0, duration: 1, ease: "power4.out" }
// );
// gsap.fromTo(
// $(".ads-bionics-3-text-swiper .swiper-slide")[_prevIndex],
// { y: 0 },
// { y: "-100%", duration: 1, ease: "power4.out" }
// );
// $(".ads-bionics-3-swiper-control-text-active-index").attr("data-index", aiFeature3TextIndex);
// $(".ads-bionics-3-swiper .ads-bionics-3-item").each(function () {
// var _index = $(this).attr("data-index");
// _index--;
// if (_index < 0) {
// _index = $(".ads-bionics-3-swiper .ads-bionics-3-item").length - 1;
// }
// $(this).attr("data-index", _index);
// });
// }, 4000);
// });
// WebP支持检测(首次运行时缓存结果)
function checkWebPSupport(callback) {
if (typeof localStorage !== 'undefined' && localStorage.getItem('webpSupport') !== null) {
return callback(localStorage.getItem('webpSupport') === 'true');
}
const img = new Image();
img.onload = function () {
const result = img.width > 0 && img.height > 0;
localStorage.setItem('webpSupport', result);
callback(result);
};
img.onerror = function () {
localStorage.setItem('webpSupport', false);
callback(false);
};
img.src =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=';
}
checkWebPSupport(function (isSupported) {
$('img').each(function () {
const $img = $(this);
let webpSrc = $img.closest('picture').find('source[type="image/webp"]').data('srcset');
const webpSrcMob = $img
.closest('picture')
.find('source[type="image/webp"][media*="max-width: 900px"]')
.data('srcset');
if ($(window).width() < 900) {
if (webpSrcMob != undefined) {
webpSrc = webpSrcMob;
}
}
const fallbackSrc = $img.data('src');
// 动态设置真实图片路径
$img.data('original', isSupported ? webpSrc : fallbackSrc);
});
$('img').lazyload({
threshold: 200,
effect: 'fadeIn',
appear: function () {
const realSrc = $(this).data('original');
$(this).attr('src', realSrc);
$(this).addClass('lazy-loaded');
},
load: function () {
$(this).addClass('lazy-loaded');
},
error: function () {
$(this).attr('src', 'img/error.jpg');
},
});
});
// 初始化懒加载
$('img').lazyload({
effect: 'fadeIn', // 淡入效果
threshold: 100, // 提前300px加载
failure_limit: 15, // 最大容错数量
skip_invisible: true, // 加载隐藏图片
appear: function () {
// 加载前回调
// $(this).css('background', 'transparent')
// $(this).removeClass('lazyload')
let _this = $(this);
if (_this.data('original') != undefined) {
_this.on('load', function () {
// _this.css("background", "transparent");
_this.removeClass('lazyload');
});
}
},
load: function () {
// 加载完成回调
$(this).addClass('lazy-loaded');
},
});
// 20250519
// 第一屏
var screenwidth = $(window).width();
// $('.sec_height_box1').height($('.sec_dingwei_box1').height())
// $('.sec_height_box2').height($('.sec_dingwei_box2').height())
if (screenwidth < 2570) {
// if (screenwidth < 70) {
window.addEventListener('scroll', function () {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
var scrollHeight = $('.ias-ads-title1').height();
var scrHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
var src = (scrollTop / scrHeight) * 100;
var fixedh = $('.ias-ads-kv-bg').offset().top + 300;
// document.querySelector('.ias-ads-kv-con').style.transform = `translateY(${src}%)`
// if ((scrollTop > 0 && screenwidth >= 800) || screenwidth <= 500) {
// $('.ias-ads-kv-con,.ias-con-bg').addClass('active')
// } else {
// $('.ias-ads-kv-con,.ias-con-bg').removeClass('active')
// }
// console.log(scrollTop)
// console.log(fixedh)
if (
(scrollTop >= fixedh && screenwidth >= 850) ||
(scrollTop >= fixedh && screenwidth <= 500)
) {
$('.ias-ads-kv-con,.ias-con-bg').addClass('active');
document.querySelector('.ias-ads-kv-con').style.top = '-300px';
} else {
$('.ias-ads-kv-con,.ias-con-bg').removeClass('active');
document.querySelector('.ias-ads-kv-con').style.top = '0';
}
});
if (screenwidth >= 500 && screenwidth <= 850) {
window.addEventListener('scroll', function () {
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
var scrollHeight = $('.ias-ads-title1').height();
var scrHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
var src = (scrollTop / scrHeight) * 100;
var fixedh = $('.ias-ads-kv-con').offset().top + 600;
if (scrollTop >= fixedh && screenwidth >= 500 && screenwidth <= 850) {
$('.ias-ads-kv-con,.ias-con-bg').addClass('active');
document.querySelector('.ias-ads-kv-con').style.top = '-600px';
} else {
// this.alert(123)
$('.ias-ads-kv-con,.ias-con-bg').removeClass('active');
document.querySelector('.ias-ads-kv-con').style.top = '0';
}
});
}
// 第二屏
var FirstmaxScale = 2.5;
if (screenwidth <= 500) {
FirstmaxScale = 1.3;
}
if (screenwidth <= 370) {
FirstmaxScale = 1.2;
}
var flag = true;
window.onscroll = function () {
if (flag) {
function rotat(a) {
var rotatable = document.getElementById('title');
var maxRotation = 60;
var maxScale = FirstmaxScale;
var maxSopacity = 2;
var docScrollTop = document.documentElement.scrollTop;
var maxScrollTop = a;
var scrollRatio = docScrollTop / maxScrollTop;
var rotation = maxRotation * scrollRatio - (maxRotation * scrollRatio ** 2) / 2;
var scale = maxScale - maxScale * scrollRatio;
var opacity = maxSopacity - maxSopacity * scrollRatio;
if (scale <= 1) {
rotatable.style.transform = 'scale(' + 1 + ', ' + 1 + ')';
} else {
rotatable.style.transform = 'scale(' + scale + ', ' + scale + ')';
}
}
function rotat1(a, b) {
var rotatable1 = document.getElementById('title1');
var maxRotation1 = 60;
var maxScale1 = FirstmaxScale;
var maxSopacity1 = 2;
var docScrollTop1 = document.documentElement.scrollTop;
var maxScrollTop1 = a;
var scrollRatio1 = docScrollTop1 / maxScrollTop1;
var rotation1 = maxRotation1 * scrollRatio1 - (maxRotation1 * scrollRatio1 ** 2) / 2;
var scale1 = maxScale1 - maxScale1 * scrollRatio1;
var opacity1 = scrollRatio1;
rotatable1.style.transform = 'scale(' + scale1 + ', ' + scale1 + ')';
if (docScrollTop1 > b) {
// rotatable1.style.opacity = opacity1
} else {
rotatable1.style.opacity = 0;
}
if (scale1 <= 1) {
rotatable1.style.transform = 'scale(' + 1 + ', ' + 1 + ')';
rotatable1.style.opacity = 1;
} else {
rotatable1.style.transform = 'scale(' + scale1 + ', ' + scale1 + ')';
rotatable1.style.opacity = 1;
}
}
// 标题2
// function rotat0(a) {
// var rotatable = document.getElementById('title0');
// var maxRotation = 60;
// var maxScale = 3.5;
// var maxSopacity = 2;
// var docScrollTop = document.documentElement.scrollTop;
// var maxScrollTop = a;
// var scrollRatio = docScrollTop / maxScrollTop;
// var rotation = maxRotation * scrollRatio - (maxRotation * scrollRatio ** 2) / 2;
// var scale = maxScale - maxScale * scrollRatio;
// var opacity = maxSopacity - maxSopacity * scrollRatio;
// if (scale <= 1) {
// rotatable.style.transform = 'scale(' + 1 + ', ' + 1 + ')';
// } else {
// rotatable.style.transform = 'scale(' + scale + ', ' + scale + ')';
// }
// }
// function rotat01(a, b) {
// var rotatable1 = document.getElementById('title01');
// var maxRotation1 = 60;
// var maxScale1 = 3.5;
// var maxSopacity1 = 2;
// var docScrollTop1 = document.documentElement.scrollTop;
// var maxScrollTop1 = a;
// var scrollRatio1 = docScrollTop1 / maxScrollTop1;
// var rotation1 = maxRotation1 * scrollRatio1 - (maxRotation1 * scrollRatio1 ** 2) / 2;
// var scale1 = maxScale1 - maxScale1 * scrollRatio1;
// var opacity1 = scrollRatio1;
// rotatable1.style.transform = 'scale(' + scale1 + ', ' + scale1 + ')';
// if (docScrollTop1 > b) {
// // rotatable1.style.opacity = opacity1
// } else {
// rotatable1.style.opacity = 0;
// }
// if (scale1 <= 1) {
// rotatable1.style.transform = 'scale(' + 1 + ', ' + 1 + ')';
// rotatable1.style.opacity = 1;
// } else {
// rotatable1.style.transform = 'scale(' + scale1 + ', ' + scale1 + ')';
// rotatable1.style.opacity = 1;
// }
// }
// 标题3
// function rotat03(a) {
// var rotatable = document.getElementById('title03');
// var maxRotation = 60;
// var maxScale = 4;
// var maxSopacity = 2;
// var docScrollTop = document.documentElement.scrollTop;
// var maxScrollTop = a;
// var scrollRatio = docScrollTop / maxScrollTop;
// var rotation = maxRotation * scrollRatio - (maxRotation * scrollRatio ** 2) / 2;
// var scale = maxScale - maxScale * scrollRatio;
// var opacity = maxSopacity - maxSopacity * scrollRatio;
// if (scale <= 1) {
// rotatable.style.transform = 'scale(' + 1 + ', ' + 1 + ')';
// } else {
// rotatable.style.transform = 'scale(' + scale + ', ' + scale + ')';
// }
// }
// function rotat003(a, b) {
// var rotatable1 = document.getElementById('title003');
// var maxRotation1 = 60;
// var maxScale1 = 4;
// var maxSopacity1 = 2;
// var docScrollTop1 = document.documentElement.scrollTop;
// var maxScrollTop1 = a;
// var scrollRatio1 = docScrollTop1 / maxScrollTop1;
// var rotation1 = maxRotation1 * scrollRatio1 - (maxRotation1 * scrollRatio1 ** 2) / 2;
// var scale1 = maxScale1 - maxScale1 * scrollRatio1;
// var opacity1 = scrollRatio1;
// rotatable1.style.transform = 'scale(' + scale1 + ', ' + scale1 + ')';
// if (docScrollTop1 > b) {
// // rotatable1.style.opacity = opacity1
// } else {
// rotatable1.style.opacity = 0;
// }
// if (scale1 <= 1) {
// rotatable1.style.transform = 'scale(' + 1 + ', ' + 1 + ')';
// rotatable1.style.opacity = 1;
// } else {
// rotatable1.style.transform = 'scale(' + scale1 + ', ' + scale1 + ')';
// rotatable1.style.opacity = 1;
// }
// }
// 标题4
// function rotat04(a) {
// var rotatable = document.getElementById('title04');
// var maxRotation = 60;
// var maxScale = 3.5;
// var maxSopacity = 2;
// var docScrollTop = document.documentElement.scrollTop;
// var maxScrollTop = a;
// var scrollRatio = docScrollTop / maxScrollTop;
// var rotation = maxRotation * scrollRatio - (maxRotation * scrollRatio ** 2) / 2;
// var scale = maxScale - maxScale * scrollRatio;
// var opacity = maxSopacity - maxSopacity * scrollRatio;
// if (scale <= 1) {
// rotatable.style.transform = 'scale(' + 1 + ', ' + 1 + ')';
// } else {
// rotatable.style.transform = 'scale(' + scale + ', ' + scale + ')';
// }
// }
// function rotat004(a, b) {
// var rotatable1 = document.getElementById('title004');
// var maxRotation1 = 60;
// var maxScale1 = 3.5;
// var maxSopacity1 = 2;
// var docScrollTop1 = document.documentElement.scrollTop;
// var maxScrollTop1 = a;
// var scrollRatio1 = docScrollTop1 / maxScrollTop1;
// var rotation1 = maxRotation1 * scrollRatio1 - (maxRotation1 * scrollRatio1 ** 2) / 2;
// var scale1 = maxScale1 - maxScale1 * scrollRatio1;
// var opacity1 = scrollRatio1;
// rotatable1.style.transform = 'scale(' + scale1 + ', ' + scale1 + ')';
// if (docScrollTop1 > b) {
// // rotatable1.style.opacity = opacity1
// } else {
// rotatable1.style.opacity = 0;
// }
// if (scale1 <= 1) {
// rotatable1.style.transform = 'scale(' + 1 + ', ' + 1 + ')';
// rotatable1.style.opacity = 1;
// } else {
// rotatable1.style.transform = 'scale(' + scale1 + ', ' + scale1 + ')';
// rotatable1.style.opacity = 1;
// }
// }
if (screenwidth <= 2700 && screenwidth >= 2160) {
rotat(1400);
rotat1(1400, 600);
// rotat0(9600);
// rotat01(9600, 600);
// rotat03(15000);
// rotat003(15000, 600);
// rotat04(17000);
// rotat004(17000, 600);
}
if (screenwidth <= 2170 && screenwidth >= 1930) {
rotat(1200);
rotat1(1200, 200);
// rotat0(8000);
// rotat01(8000, 600);
// rotat03(13000);
// rotat003(13000, 600);
// rotat04(15000);
// rotat004(15000, 600);
}
if (screenwidth <= 1930 && screenwidth >= 1600) {
rotat(1400);
rotat1(1400, 600);
// rotat0(5800);
// rotat01(5800, 3000);
// rotat03(11000);
// rotat003(11000, 600);
// rotat04(13000);
// rotat004(13000, 600);
}
if (screenwidth <= 1600 && screenwidth >= 1500) {
rotat(1200);
rotat1(1200, 400);
// rotat0(5000);
// rotat01(5000, 3000);
// rotat03(9000);
// rotat003(9000, 600);
// rotat04(11000);
// rotat004(11000, 600);
}
if (screenwidth <= 1500 && screenwidth >= 1380) {
rotat(1200);
rotat1(1200, 400);
// rotat0(4500);
// rotat01(4500, 600);
// rotat03(8000);
// rotat003(8000, 600);
// rotat04(9500);
// rotat004(9500, 600);
}
if (screenwidth <= 1380 && screenwidth >= 1200) {
rotat(600);
rotat1(600, 50);
// rotat0(4400);
// rotat01(4400, 600);
// rotat03(8400);
// rotat003(8400, 600);
// rotat04(9000);
// rotat004(9000, 600);
}
if (screenwidth <= 1200 && screenwidth >= 900) {
rotat(300);
rotat1(300, 50);
// rotat0(3800);
// rotat01(3800, 600);
// rotat03(7000);
// rotat003(7000, 600);
// rotat04(8000);
// rotat004(8000, 600);
}
if (screenwidth <= 900 && screenwidth >= 500) {
rotat(1200);
rotat1(1200, 200);
// rotat0(6800);
// rotat01(6800, 600);
// rotat03(11700);
// rotat003(11700, 600);
// rotat04(14800);
// rotat004(14800, 600);
}
if (screenwidth <= 500) {
rotat(1600);
rotat1(1600, 1200);
// rotat0(3200);
// rotat01(3200, 600);
// rotat03(6000);
// rotat003(6000, 600);
// rotat04(7500);
// rotat004(7500, 600);
}
}
};
// 20250520 块内动效
// $('.sec_height_box1').height($('.sec_dingwei_box1').height())
// $('.sec_height_box2').height($('.sec_dingwei_box2').height())
// // $('.sec_height_box3').height($('.sec_dingwei_box3').height())
$(window).scroll(function () {
var scrollTop = $(window).scrollTop();
var pageHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
var fixedh1 = $('.sec_waibu_box1').offset().top + 100;
if (scrollTop >= fixedh1) {
$('.sec_dingwei_box1').addClass('active');
document.querySelector('.sec_dingwei_box1').style.top = '-100px';
var scrollableHeight1 = pageHeight - $('.sec_waibu_box1').offset().top;
var src1 = ((scrollTop - $('.sec_waibu_box1').offset().top) / scrollableHeight1) * 100;
// document.querySelector('.sec_dingwei_box1').style.transform = `translateY(${src1}%)`
// 20250522
if (screenwidth >= 500 && screenwidth <= 800) {
var fixedh1 = $('.sec_waibu_box1').offset().top + 400;
var fixetop1 = $('.sec_waibu_box1').offset().top;
var toh1 = fixedh1 - fixetop1;
// alert(toh1)
if (scrollTop >= fixedh1) {
$('.sec_dingwei_box1').addClass('active');
// document.querySelector('.sec_dingwei_box1').style.top = '-400px'
document.querySelector('.sec_dingwei_box1').style.top = `-${toh1}px`;
} else {
$('.sec_dingwei_box1').removeClass('active');
document.querySelector('.sec_dingwei_box1').style.top = '0';
}
}
} else {
$('.sec_dingwei_box1').removeClass('active');
document.querySelector('.sec_dingwei_box1').style.top = '0';
// document.querySelector('.sec_dingwei_box1').style.transform = `translateY(0)`
}
var fixedh2 = $('.sec_waibu_box2').offset().top + 100;
if (scrollTop >= fixedh2) {
$('.sec_dingwei_box2').addClass('active');
document.querySelector('.sec_dingwei_box2').style.top = '-100px';
var scrollableHeight2 = pageHeight - $('.sec_waibu_box2').offset().top;
var src1 = ((scrollTop - $('.sec_waibu_box2').offset().top) / scrollableHeight2) * 100;
// document.querySelector('.sec_dingwei_box2').style.transform = `translateY(${src1}%)`
if (screenwidth >= 500 && screenwidth <= 800) {
var fixedh2 = $('.sec_waibu_box2').offset().top + 400;
var fixetop2 = $('.sec_waibu_box2').offset().top;
var toh2 = fixedh2 - fixetop2;
// alert(toh1)
if (scrollTop >= fixedh2) {
$('.sec_dingwei_box2').addClass('active');
// document.querySelector('.sec_dingwei_box1').style.top = '-400px'
document.querySelector('.sec_dingwei_box2').style.top = `-${toh2}px`;
} else {
$('.sec_dingwei_box2').removeClass('active');
document.querySelector('.sec_dingwei_box2').style.top = '0';
}
}
} else {
$('.sec_dingwei_box2').removeClass('active');
document.querySelector('.sec_dingwei_box2').style.top = '0';
// document.querySelector('.sec_dingwei_box2').style.transform = `translateY(0)`
}
if (scrollTop >= $('.sec_waibu_box3').offset().top + 400) {
$('.sec_dingwei_box3').addClass('active');
document.querySelector('.sec_dingwei_box3').style.top = '-400px';
// var scrollableHeight3 = pageHeight - $('.sec_waibu_box3').offset().top
// var src1 = ((scrollTop - $('.sec_waibu_box3').offset().top) / scrollableHeight3) * 100
// document.querySelector('.sec_dingwei_box3').style.transform = `translateY(${src1}%)`
if (screenwidth >= 500 && screenwidth <= 850) {
var fixedh3 = $('.sec_waibu_box3').offset().top + 1300;
var fixetop3 = $('.sec_waibu_box3').offset().top;
var toh3 = fixedh3 - fixetop3;
// alert(toh1)
if (scrollTop >= fixedh3) {
$('.sec_dingwei_box3').addClass('active');
// document.querySelector('.sec_dingwei_box1').style.top = '-400px'
document.querySelector('.sec_dingwei_box3').style.top = `-${toh3}px`;
} else {
$('.sec_dingwei_box3').removeClass('active');
document.querySelector('.sec_dingwei_box3').style.top = '0';
}
}
} else {
$('.sec_dingwei_box3').removeClass('active');
document.querySelector('.sec_dingwei_box3').style.top = '0';
// document.querySelector('.sec_dingwei_box3').style.transform = `translateY(0)`
}
// 251213
var fixedh4 = $('.sec_waibu_box4').offset().top + 100;
if (scrollTop >= fixedh4) {
$('.sec_dingwei_box4').addClass('active');
document.querySelector('.sec_dingwei_box4').style.top = '-100px';
var scrollableHeight4 = pageHeight - $('.sec_waibu_box4').offset().top;
var src1 = ((scrollTop - $('.sec_waibu_box4').offset().top) / scrollableHeight4) * 100;
// document.querySelector('.sec_dingwei_box4').style.transform = `translateY(${src1}%)`
if (screenwidth >= 500 && screenwidth <= 800) {
var fixedh4 = $('.sec_waibu_box4').offset().top + 400;
var fixetop4 = $('.sec_waibu_box4').offset().top;
var toh4 = fixedh4 - fixetop4;
// alert(toh1)
if (scrollTop >= fixedh4) {
$('.sec_dingwei_box4').addClass('active');
// document.querySelector('.sec_dingwei_box1').style.top = '-400px'
document.querySelector('.sec_dingwei_box4').style.top = `-${toh4}px`;
} else {
$('.sec_dingwei_box4').removeClass('active');
document.querySelector('.sec_dingwei_box4').style.top = '0';
}
}
} else {
$('.sec_dingwei_box4').removeClass('active');
document.querySelector('.sec_dingwei_box4').style.top = '0';
// document.querySelector('.sec_dingwei_box4').style.transform = `translateY(0)`
}
});
// }
}
function getUrlParam(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
if (getUrlParam('id') == 'p2p') {
if (screenwidth > 900) {
if (!localStorage.getItem('pageOpened')) {
localStorage.setItem('pageOpened', 'true');
$('body,html').animate(
{
scrollTop: $('#p2p').offset().top + 120,
},
1000
);
} else {
$('body,html').animate(
{
scrollTop: $('#p2p').offset().top - 760,
},
1000
);
}
} else {
if (!localStorage.getItem('pageOpened')) {
localStorage.setItem('pageOpened', 'true');
// console.log('首次打开')
$('body,html').animate(
{
scrollTop: $('#p2p').offset().top - 100,
},
1000
);
} else {
// console.log('已打开过')
$('body,html').animate(
{
scrollTop: $('#p2p').offset().top - 280,
},
1000
);
}
}
}
// 二级导航 20250710
let windowHeight = window.innerHeight;
let threeQuartersHeight = windowHeight * 0.55;
if ($(window) < 899) {
threeQuartersHeight = windowHeight * 0.15;
}
let prevScroll = 0;
$(window).scroll(function () {
if ($(this).scrollTop() >= threeQuartersHeight) {
$('#localnav').addClass('active');
} else {
$('#localnav').removeClass('active');
}
$('#localnav').removeClass('ln-expanded');
});
$('#localnav .ln-title ').click(function () {
$('#localnav').toggleClass('ln-expanded');
});
$('.ln-menu-list .ln-menu-item').each(function (i) {
var lab = $(this).find('a').attr('href');
$(this).click(function () {
if (screenwidth > 900) {
var top = $(lab).offset().top - 100;
} else {
var top = $(lab).offset().top;
}
$('body,html').animate(
{
scrollTop: top,
},
1000
);
$('#title').css('transform', 'scale(1, 1)');
$('#title1').css('transform', 'scale(1, 1)');
// $('#title0').css('transform', 'scale(1, 1)');
// $('#title01').css('transform', 'scale(1, 1)');
// $('#title03').css('transform', 'scale(1, 1)');
// $('#title003').css('transform', 'scale(1, 1)');
// $('#title04').css('transform', 'scale(1, 1)');
// $('#title004').css('transform', 'scale(1, 1)');
flag = false;
setTimeout(function () {
flag = true;
}, 1100);
});
});
$('.ias-ads-kvnav li').each(function (i) {
var lab = $(this).attr('data-href');
$(this).click(function () {
if (screenwidth > 900) {
var top = $(lab).offset().top - 100;
} else {
var top = $(lab).offset().top;
}
$('body,html').animate(
{
scrollTop: top,
},
1000
);
$('#title').css('transform', 'scale(1, 1)');
$('#title1').css('transform', 'scale(1, 1)');
$('#title0').css('transform', 'scale(1, 1)');
$('#title01').css('transform', 'scale(1, 1)');
$('#title03').css('transform', 'scale(1, 1)');
$('#title003').css('transform', 'scale(1, 1)');
$('#title04').css('transform', 'scale(1, 1)');
$('#title004').css('transform', 'scale(1, 1)');
flag = false;
setTimeout(function () {
flag = true;
}, 1100);
});
});
});