-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop.js
81 lines (54 loc) · 2.39 KB
/
loop.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
function setUp() {
var oner = document.getElementById("one");
var twoer = document.getElementById("two");
var threer = document.getElementById("three");
var fourer = document.getElementById("four");
var fiver = document.getElementById("five");
var sixer = document.getElementById("six");
var sevener = document.getElementById("seven");
var eighter = document.getElementById("eight");
var niner = document.getElementById("nine");
var tener = document.getElementById("ten");
var navBar = document.getElementById("header-wrapper");
var navPage = document.getElementById("navigation-page");
var hamBurger = document.getElementById("toggle-setting");
hamBurger.onclick = function() {
if (navPage.className == "") {
navPage.className = "open";
hamBurger.removeAttribute("src");
hamBurger.setAttribute("src", "images/icon-close.svg");
}
else {
navPage.className = "";
hamBurger.removeAttribute("src");
hamBurger.setAttribute("src", "images/icon-hamburger.svg");
}
}
if (document.body.clientWidth >= 1024) {
navBar.removeChild(hamBurger);
navBar.appendChild(navPage);
oner.removeAttribute("src");
oner.setAttribute("src", "images/desktop/image-hero.jpg");
twoer.removeAttribute("src");
twoer.setAttribute("src", "images/desktop/image-interactive.jpg");
threer.removeAttribute("src");
threer.setAttribute("src", "images/desktop/image-deep-earth.jpg");
fourer.removeAttribute("src");
fourer.setAttribute("src", "images/desktop/image-night-arcade.jpg");
fiver.removeAttribute("src");
fiver.setAttribute("src", "images/desktop/image-soccer-team.jpg");
sixer.removeAttribute("src");
sixer.setAttribute("src", "images/desktop/image-grid.jpg");
sevener.removeAttribute("src");
sevener.setAttribute("src", "images/desktop/image-from-above.jpg");
eighter.removeAttribute("src");
eighter.setAttribute("src", "images/desktop/image-pocket-borealis.jpg");
niner.removeAttribute("src");
niner.setAttribute("src", "images/desktop/image-curiosity.jpg" );
tener.removeAttribute("src");
tener.setAttribute("src", "images/desktop/image-fisheye.jpg" );
}
}
window.onload = function() {
setUp();
}