风大四发安抚打算
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yiqiu
2025-11-23 00:53:08 +08:00
parent 08e308b58d
commit e4fb0b6135
2 changed files with 56 additions and 5 deletions

View File

@@ -25,10 +25,34 @@ $(function () {
disableOnInteraction: false, // 用户操作后继续自动播放
},
speed: 800, // 切换速度
// 如果需要分页器
// 分页器配置
pagination: {
el: ".swiper-pagination",
clickable: true,
type: 'bullets',
},
// 监听切换事件,重置进度条动画
on: {
slideChange: function () {
// 移除所有进度条动画
document.querySelectorAll('.swiper-pagination-bullet').forEach(function(bullet) {
bullet.classList.remove('progress-active');
});
// 给当前激活的添加进度动画
const activeBullet = document.querySelector('.swiper-pagination-bullet-active');
if (activeBullet) {
activeBullet.classList.add('progress-active');
}
},
init: function () {
// 初始化时给第一个添加进度动画
setTimeout(function() {
const activeBullet = document.querySelector('.swiper-pagination-bullet-active');
if (activeBullet) {
activeBullet.classList.add('progress-active');
}
}, 100);
}
}
});
})