Skip to content

Commit 4edc66b

Browse files
committed
Fixed issue with the subsequence elements are ignored with 'once:true'
1 parent 98f65cc commit 4edc66b

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
**/test
1+
**/test
2+
**/.vscode

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77

88
export default function scrollObserver(selector, option) {
9-
let showCount = 0
109
let observer = new IntersectionObserver((entries) => {
1110
entries.forEach(entry => {
1211
window.requestIdleCallback(() => {
12+
let showCount = 0
1313
if (option?.once) {
1414
if (showCount === 0 && entry.isIntersecting) {
1515
entry.target.classList.add('shown')

index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)