滾動條動畫
使用到的js庫
jquery.js
ScrollMagic.js
gsap.js
頁面引入js

使用動畫

轉換滾動數據的函數調用說明:

函數:
function handleProgress({ start, end, progress, portions = 100, progressCallback, initStart, initEnd }) {
if (progress < start) {
initStart && initStart()
}
if (progress > end) {
initEnd && initEnd()
}
// 區間內觸發
if (progress >= start && progress <= end) {
// 把起點變成0
let progressNum = progress - start;
// 滾動區間距離值
let interval = end - start;
progressCallback && progressCallback(progressNum / (interval / portions))
}
}
調用函數:


浙公網安備 33010602011771號