-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
22 lines (17 loc) · 765 Bytes
/
main.js
File metadata and controls
22 lines (17 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$(document).ready(function() {
var body = document.body,
html = document.documentElement;
var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
var $window = $(window).scroll(function(){
var percentDown = (document.documentElement.scrollTop/(height-window.innerHeight))
console.log(percentDown)
var percentUp = 1-percentDown
document.getElementsByClassName("background")[0].style.transform = "translateY(-"+(percentUp*100)+"vh)"
});
$('.option').on('click', function(){
window.location.href = $(this).attr('link');
})
$('.topBox').on('click', function(){
window.location.href = "/info.html";
})
});