File tree 1 file changed +0
-20
lines changed
1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -58,26 +58,6 @@ <h1>Slide in on Scroll</h1>
58
58
} ;
59
59
}
60
60
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
-
81
61
</ script >
82
62
83
63
< style >
You can’t perform that action at this time.
0 commit comments