-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
84 lines (75 loc) · 2.63 KB
/
Copy pathscript.js
File metadata and controls
84 lines (75 loc) · 2.63 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
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
79
80
81
82
83
84
//Menu change function for Nav when mobile version
/* Toggle between showing and hiding the navigation menu links when the user clicks on the hamburger menu / bar icon */
const button = document.getElementById("my-button");
const nav = document.getElementById("myLinks");
button.addEventListener("click", () => {
nav.classList.toggle("show");
});
//PARKS PAGE JS
// Get the modal
const modal = document.getElementById("myModal");
// Get the image and insert it inside the modal - use its "alt" text as a caption
//africa
const serengeti = document.getElementById("serengeti");
const kruger = document.getElementById("kruger");
const hwange = document.getElementById("hwange");
const bwindi = document.getElementById("bwindi");
//asia
const khao = document.getElementById("khao");
const huangshan = document.getElementById("huangshan");
const fuji = document.getElementById("fuji");
const nikko = document.getElementById("nikko");
//america
const banff = document.getElementById("banff");
const galapagos = document.getElementById("galapagos");
const torresDelPaine = document.getElementById("torresDelPaine");
const yellowstone = document.getElementById("yellowstone");
//europe
const plitvice = document.getElementById("plitvice");
const teide = document.getElementById("teide");
const skjoldungernes = document.getElementById("skjoldungernes");
const vatnajokull = document.getElementById("vatnajokull");
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
function imgBig(event) {
modal.style.display = "block";
modalImg.src = event.target.src;
captionText.innerHTML = event.target.alt;
console.log("test");
}
//Parks functions
if (serengeti) {
serengeti.onclick = imgBig;
kruger.onclick = imgBig;
hwange.onclick = imgBig;
bwindi.onclick = imgBig;
//Asia
khao.onclick = imgBig;
huangshan.onclick = imgBig;
fuji.onclick = imgBig;
nikko.onclick = imgBig;
//america
banff.onclick = imgBig;
galapagos.onclick = imgBig;
torresDelPaine.onclick = imgBig;
yellowstone.onclick = imgBig;
//europe
plitvice.onclick = imgBig;
teide.onclick = imgBig;
skjoldungernes.onclick = imgBig;
vatnajokull.onclick = imgBig;
}
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks on <span> (x), close the modal
if (span) {
span.onclick = function () {
modal.style.display = "none";
};
}
//Form page SUBMIT
const submitButton = document.getElementById("contactForm");
submitButton.onclick = function () {
console.log("form submit");
alert("Thank you for submitting your form, your message has been received.");
};