1
0

优化响应式设计,调整轮播图样式;新增客户案例页面及动态详情页面;更新产品信息,确保内容准确;增加图片以增强视觉效果。

This commit is contained in:
2026-04-20 17:33:51 +08:00
parent 12de99c55e
commit e07ef024c0
11 changed files with 634 additions and 22 deletions

View File

@@ -148,7 +148,9 @@
return;
}
var fallbackTimer = setTimeout(finish, 2500);
// Allow enough time for large hero backgrounds on slower networks
// before falling back to the default loading timeout.
var fallbackTimer = setTimeout(finish, 8000);
$.each(backgroundUrls, function(index, backgroundUrl) {
var image = new Image();
@@ -178,6 +180,20 @@
});
}
function getHeroInterleaveOffset() {
var windowWidth = window.innerWidth;
if (windowWidth <= 767) {
return 0.05;
}
if (windowWidth <= 991) {
return 0.08;
}
return 0.12;
}
// DATA BACKGROUND IMAGE
var sliderBgSetting = $(".slide-bg-image");
sliderBgSetting.each(function(indx){
@@ -200,24 +216,24 @@
// HERO SLIDER
if (typeof Swiper === "function" && jQuery(".swiper-container").length) {
if (typeof Swiper === "function" && jQuery(".hero-slider .swiper-container").length) {
var $heroSlider = jQuery(".hero-slider .swiper-container");
var menu = [];
jQuery('.swiper-slide').each( function(index){
$heroSlider.find('.swiper-slide').each( function(index){
menu.push( jQuery(this).find('.slide-inner').attr("data-text") );
});
var totalSlides = jQuery(".swiper-slide").length;
var interleaveOffset = 0.16;
var totalSlides = $heroSlider.find(".swiper-slide").length;
var shouldLoop = totalSlides > 2;
var swiperOptions = {
loop: true,
loopedSlides: totalSlides,
loop: shouldLoop,
preloadImages: true,
updateOnImagesReady: true,
speed: 1000,
parallax: true,
autoplay: {
autoplay: totalSlides > 1 ? {
delay: 6500,
disableOnInteraction: false,
},
} : false,
watchSlidesProgress: true,
pagination: {
el: '.swiper-pagination',
@@ -232,8 +248,9 @@
on: {
progress: function() {
var swiper = this;
var interleaveOffset = getHeroInterleaveOffset();
for (var i = 0; i < swiper.slides.length; i++) {
var slideProgress = swiper.slides[i].progress;
var slideProgress = Math.max(Math.min(swiper.slides[i].progress, 1), -1);
var innerOffset = swiper.width * interleaveOffset;
var innerTranslate = slideProgress * innerOffset;
var slideInner = swiper.slides[i].querySelector(".slide-inner");
@@ -266,7 +283,11 @@
}
};
var swiper = new Swiper(".swiper-container", swiperOptions);
if (shouldLoop) {
swiperOptions.loopedSlides = totalSlides;
}
var swiper = new Swiper(".hero-slider .swiper-container", swiperOptions);
}