-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
29 lines (26 loc) · 892 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* If you're feeling fancy you can add interactivity
to your site with Javascript */
// prints "hi" in the browser's dev tools console
var animating = false;
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll > 100) {
$(".reveal-image").addClass("full-image");
$(".reveal-text").removeClass("hide");
$(".reveal-text").removeClass("hidden");
if (!$(".reveal-lead").hasClass("hidden") && !animating) {
animating = true;
setTimeout(function() {
if ($(window).scrollTop() > 100) {
$(".reveal-lead").addClass("hidden");
}
animating = false;
}, 500);
}
} else {
$(".reveal-image").removeClass("full-image");
$(".reveal-text").addClass("hide");
$(".reveal-text").addClass("hidden");
$(".reveal-lead").removeClass("hidden");
}
});