Skip to content

Commit

Permalink
新增:产品自动5s轮播
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Dec 17, 2024
1 parent 0dad1dd commit 576aa0c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions js/index.js
Original file line number Diff line number Diff line change
@@ -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],
Expand Down

0 comments on commit 576aa0c

Please # to comment.