We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc02b58 commit 1357fd4Copy full SHA for 1357fd4
13 - Slide in on Scroll/index-START.html
@@ -58,6 +58,16 @@ <h1>Slide in on Scroll</h1>
58
};
59
}
60
61
+ let last_known_scroll_position = window.scrollY;
62
+ let imgs = document.querySelectorAll('img');
63
+ window.addEventListener('scroll', () => {
64
+ last_known_scroll_position = window.scrollY;
65
+ for (let i = 0; i < imgs.length; i++) {
66
+ if (last_known_scroll_position >= imgs[i].y) {
67
+ imgs[i].classList.add('active');
68
+ }
69
70
+ })
71
</script>
72
73
<style>
0 commit comments