css:
.textWrapper {
display: block;
width: 100%;
height: 100vh;
}
.sideText {
float: right;
width: 40%;
margin-right: 50px;
padding-top: 20%;
}
.sizing img {
height: 101vh;
margin: -8px 0 0 -8px;
}
.sizing {
position: fixed;
-webkit-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
opacity: 0;
display: block;
}
.active{
opacity: 1;
}
$(document).scroll(function() {
var scrollY = window.scrollY;
var images = $('.sizing');
if (scrollY<100){
$(images[0]).addClass('active').siblings().removeClass('active');
} else if (scrollY>100 && scrollY<=500){
$(images[1]).addClass('active').siblings().removeClass('active');
} else if (scrollY>500 && scrollY<=1000){
$(images[2]).addClass('active').siblings().removeClass('active');
} else{
$(images[3]).addClass('active').siblings().removeClass('active');
}
});