jQuery(function($) {
// WHAT WE DO - ANIMATE PARAGRAPHS With FADE IN FROM LEFT
var done = false;
$(window).scroll(function() {
if (!done) {
var y = $(window).scrollTop(),
x = $('.div2').offset().top - 10;
if (y > x) {
done = true;
$('.div4')
.delay(0)
.animate({
opacity: 1,
marginLeft: '+=50'
});
}
if (y > x) {
done = true;
$('.div5')
.delay(1000)
.animate({
opacity: 1,
marginLeft: '+=50'
});
}
if (y > x) {
done = true;
$('.div6')
.delay(2000)
.animate({
opacity: 1,
marginLeft: '+=50'
});
}
if (y > x) {
done = true;
$('.div7')
.delay(3000)
.animate({
opacity: 1,
marginLeft: '+=50'
});
}
if (y > x) {
done = true;
$('.div8')
.delay(4000)
.animate({
opacity: 1,
marginLeft: '+=50'
});
}
}
});
// THESE RUN RIGHT AWAY BECAUSE THEY"RE IN VEIW
$('.div1').delay(300).animate({
opacity: 1,
"margin-left": '+=50'
}, 900);
$('.div2').delay(1200).animate({
opacity: 1,
"margin-left": '+=50'
}, 900);
$('.div3').delay(1900).animate({
opacity: 1,
"margin-left": '+=50'
}, 900);
}); // End jQuery
.div1,
.div2,
.div3,
.div4,
.div5,
.div6,
.div7,
.div8 {
opacity: 0;
font-size: 48px;
margin-left: -50px;
font-size: 12px!important;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div style="min-height: 2000px">
<div class="div1">
<h2 class="space_groteskmedium large-font uppercase">We come in, put our heads down, work hard, and have a hell of a time doing it. we’ve built and are continuing to build a team of great people who do great work.</h2>
</div>
<div class="div2">
<h2 class="space_groteskmedium large-font uppercase">We come in, put our heads down, work hard, and have a hell of a time doing it. we’ve built and are continuing to build a team of great people who do great work.</h2>
</div>
<div class="div3">
<h2 class="space_groteskmedium large-font uppercase">We come in, put our heads down, work hard, and have a hell of a time doing it. we’ve built and are continuing to build a team of great people who do great work.</h2>
</div>
<div class="div4">
<h2 class="space_groteskmedium large-font uppercase">We come in, put our heads down, work hard, and have a hell of a time doing it. we’ve built and are continuing to build a team of great people who do great work.</h2>
</div>
<div class="div5">
<h2 class="space_groteskmedium large-font uppercase">We come in, put our heads down, work hard, and have a hell of a time doing it. we’ve built and are continuing to build a team of great people who do great work.</h2>
</div>
<div class="div6">
<h2 class="space_groteskmedium large-font uppercase">We come in, put our heads down, work hard, and have a hell of a time doing it. we’ve built and are continuing to build a team of great people who do great work.</h2>
</div>
<div class="div7">
<h2 class="space_groteskmedium large-font uppercase">We come in, put our heads down, work hard, and have a hell of a time doing it. we’ve built and are continuing to build a team of great people who do great work.</h2>
</div>
<div class="div8">
<h2 class="space_groteskmedium large-font uppercase">We come in, put our heads down, work hard, and have a hell of a time doing it. we’ve built and are continuing to build a team of great people who do great work.</h2>
</div>
</div>