Last active
June 17, 2020 15:26
-
-
Save smallpaes/61453745842f6acc337c29b028a25530 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let callback = (entries, observer) => { | |
entries.forEach(entry => { | |
if (entry.isIntersecting) { | |
// 只在目標元素進入 viewport 時執行這裡的工作 | |
} else { | |
// 只在目標元素離開 viewport 時執行這裡的工作 | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment