Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5029405

Browse filesBrowse files
authored
Merge pull request wesbos#52 from kool-ari/master
removed answer code from index-START.html Ex 13
2 parents 3e73c6f + 92f484f commit 5029405
Copy full SHA for 5029405

File tree

Expand file treeCollapse file tree

1 file changed

+0
-20
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+0
-20
lines changed
Open diff view settings
Collapse file

‎13 - Slide in on Scroll/index-START.html‎

Copy file name to clipboardExpand all lines: 13 - Slide in on Scroll/index-START.html
-20Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,6 @@ <h1>Slide in on Scroll</h1>
5858
};
5959
}
6060

61-
const sliderImages = document.querySelectorAll('.slide-in');
62-
63-
function checkSlide(e) {
64-
sliderImages.forEach(sliderImage => {
65-
// half way through the image
66-
const slideInAt = (window.scrollY + window.innerHeight) - sliderImage.height / 2;
67-
// bottom of the image
68-
const imageBottom = sliderImage.offsetTop + sliderImage.height;
69-
const isHalfShown = slideInAt > sliderImage.offsetTop;
70-
const isNotScrolledPast = window.scrollY < imageBottom;
71-
if (isHalfShown && isNotScrolledPast) {
72-
sliderImage.classList.add('active');
73-
} else {
74-
sliderImage.classList.remove('active');
75-
}
76-
});
77-
}
78-
79-
window.addEventListener('scroll', debounce(checkSlide));
80-
8161
</script>
8262

8363
<style>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.