Skip to content

Commit 0e496d7

Browse files
authored
Adjust carousel configuration in index.html
Updated carousel settings for responsiveness and autoplay behavior.
1 parent 57f64de commit 0e496d7

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

index.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,41 +1900,40 @@ <h3 style="font-size: 22px; color:#fff; margin:0;">
19001900
if (!$diamond.length) return;
19011901

19021902
var slideCount = $diamond.children('.diamond-slide').length;
1903-
1904-
// 0/1 个:不需要 carousel
19051903
if (slideCount <= 1) return;
19061904

1907-
// >=2:启用 owl
19081905
$diamond.addClass('owl-carousel');
19091906

1910-
// 桌面端显示 2 个;移动端显示 1 个
19111907
$diamond.owlCarousel({
19121908
margin: 20,
19131909
nav: true,
19141910
dots: true,
1915-
navText: ['&#10094;','&#10095;'], // ‹ ›
1916-
autoplay: true,
1917-
autoplayHoverPause: true,
1918-
autoplayTimeout: 4500,
1911+
navText: ['&#10094;','&#10095;'],
19191912
smartSpeed: 600,
19201913

1921-
// 当总数 > 当前可见数时才 loop(比如 3 个、显示 2 个 -> 会 loop
1914+
// 3 个且显示 2 个:允许 loop
19221915
loop: (slideCount > 2),
19231916

19241917
responsive: {
19251918
0: {
19261919
items: 1,
1927-
stagePadding: 0
1920+
stagePadding: 0,
1921+
autoplay: false, // ✅ 手机不自动滚动
1922+
autoplayHoverPause: true
19281923
},
19291924
768: {
19301925
items: 2,
1931-
stagePadding: 70 // ✅ 露出一点点下一张:明确提示“还有第三个”
1926+
stagePadding: 70, // ✅ 右侧露出一点
1927+
autoplay: true, // 桌面仍可自动滚动
1928+
autoplayHoverPause: true,
1929+
autoplayTimeout: 4500
19321930
}
19331931
}
19341932
});
19351933
});
19361934
</script>
19371935

19381936

1937+
19391938
</body>
19401939
</html>

0 commit comments

Comments
 (0)