From 576aa0c2fc8a916c8581318baf4a28bf45d95042 Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Tue, 17 Dec 2024 23:46:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A85s=E8=BD=AE=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/index.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/js/index.js b/js/index.js index 2ad4df8..df373f3 100644 --- a/js/index.js +++ b/js/index.js @@ -1,14 +1,20 @@ var swiper = new Swiper(".swiper", { - loop: true, - speed: 1200, - effect: "fade", + loop: true, // 循环模式 + speed: 1200, // 动画速度 + effect: "fade", // 切换效果为淡入淡出 navigation: { - nextEl: ".swiper-button-next", - prevEl: ".swiper-button-prev", + nextEl: ".swiper-button-next", // 下一页按钮 + prevEl: ".swiper-button-prev", // 上一页按钮 + }, + + autoplay: { + delay: 5000, // 每隔5秒自动切换 + disableOnInteraction: false, // 允许用户互动后依然保持自动播放 }, }); + let animation = anime({ targets: "header", translateY: [-80, 0],