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 c8b2e98 commit 102dc28Copy full SHA for 102dc28
ScrollAnimation/script.js
@@ -0,0 +1,16 @@
1
+const contents = document.querySelectorAll('.content');
2
+
3
+const checkBoxes = () => {
4
+ const triggerBottom = (window.innerHeight / 5) * 4;
5
+ contents.forEach((content) => {
6
+ const boxTop = content.getBoundingClientRect().top;
7
+ if (boxTop < triggerBottom) {
8
+ content.classList.add('show');
9
+ } else {
10
+ content.classList.remove('show');
11
+ }
12
+ });
13
+};
14
15
+window.addEventListener('scroll', checkBoxes);
16
+checkBoxes();
0 commit comments