-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (32 loc) · 990 Bytes
/
Copy pathscript.js
File metadata and controls
36 lines (32 loc) · 990 Bytes
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
30
31
32
33
34
35
36
$(document).ready(function() {
function checkWindowSize() {
wSize = $(window).width();
console.log(wSize);
if (wSize < 900) {
$(".header").removeClass("header-fixed");
$(".header").addClass("removeFixedHeader");
$(".image-scenery").removeClass("image-scenery-fixed");
$(".image-scenery").addClass("removeFixedScenery");
}
else {
$(".header").removeClass("removeFixedHeader");
$(".header").addClass("header-fixed");
$(".image-scenery").removeClass("removeFixedScenery");
$(".image-scenery").addClass("image-scenery-fixed");
}
}
checkWindowSize();
$(window).scroll(function() {
var wScroll = $(window).scrollTop();
var windowHeight = $(window).height();
if (wScroll <= windowHeight) {
$(".title-container").css({
"transform" : "translate(0px, " + wScroll/1.5 + "%)",
"opacity" : 1 - (wScroll / (windowHeight - (windowHeight/4)))
});
}
})
$(window).resize(function() {
checkWindowSize();
});
});