-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnavBar.js
More file actions
42 lines (34 loc) · 1.08 KB
/
navBar.js
File metadata and controls
42 lines (34 loc) · 1.08 KB
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
37
38
39
40
41
42
let photo = document.getElementById("eimage");
let Navbar = document.getElementById("navbar");
let pageContent = document.getElementById("content");
var photoRotate = document.getElementById('eimage');
var path = window.location.pathname;
var pages = path.split("/").pop();
console.log( pages );
window.onscroll = function() {
if(pages == "index.html"){
photo.style.transform = "rotate("+window.pageYOffset/20+"deg)";
console.log(window.pageYOffset);
if ( window.pageYOffset > 850 ) {
console.log("hello");
photoRotate.style.position = "absolute";
photoRotate.style.marginTop ="935px";
} else {
photoRotate.style.position = "fixed";
photoRotate.style.marginTop ="80px";
}
if (window.pageYOffset >= 1600) {
navbar.classList.add("sticky");
pageContent.classList.add("content");
} else {
navbar.classList.remove("sticky");
pageContent.classList.remove("content");
}
}else{
navbar.classList.add("sticky");
pageContent.classList.add("content");
}
}
function contactus(event){
alert("Phone: (778) 123 4567 \n Email: support@startech.ca");
}