-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
66 lines (60 loc) · 1.95 KB
/
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
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
document.getElementById("ueberschrift").onmouseover = function() {
mouseOver()
};
document.getElementById("ueberschrift").onmouseout = function() {
mouseOut()
};
function mouseOver() {
document.getElementById("ueberschrift").style.color = "chartreuse";
}
function mouseOut() {
document.getElementById("ueberschrift").style.color = "midnightblue";
}
document.getElementById("orangebutton").onclick = function() {
orangebutton()
}
function orangebutton() {
document.getElementById("body").style.backgroundColor = "orange";
document.cookie = "backgroundcolor=orange";
}
document.getElementById("lavenderbutton").onclick = function() {
lavenderbutton()
}
function lavenderbutton() {
document.getElementById("body").style.backgroundColor = "lavender";
document.cookie = "backgroundcolor=lavender";
}
document.getElementById("greenbutton").onclick = function() {
greenbutton()
}
function greenbutton() {
document.getElementById("body").style.backgroundColor = "chartreuse";
document.cookie = "backgroundcolor=chartreuse";
}
var background = document.cookie;
var Wertstart = document.cookie.indexOf("=") + 1;
var Wertende = document.cookie.indexOf(";");
if (Wertende == -1) {
Wertende = document.cookie.length;
}
var Wert = document.cookie.substring(Wertstart, Wertende);
console.log(Wert);
document.getElementById("body").style.backgroundColor = Wert;
/*
function showTime() {
var jetzt = new Date();
var time = jetzt.toLocaleDateString() + ", " + jetzt.toLocaleTimeString();
document.getElementById("uhr").textContent = time;
}
window.setInterval(showTime, 1000);
*/
/*
document.getElementsByClassName("inhaltlinks")[0].onmouseover = function() {mouseOver()};
document.getElementsByClassName("inhaltlinks")[0].onmouseout = function() {mouseOut()};
function mouseOver() {
document.getElementsByClassName("inhaltlinks")[0].style.color = "red";
}
function mouseOut() {
document.getElementsByClassName("inhaltlinks")[0].style.color = "silver";
}
*/