forked from Davincii254/Catch-up-Delani
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
53 lines (48 loc) · 1.65 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
function toggleDetails(detailsId, iconClass) {
$(detailsId).toggle();
$(iconClass).toggle();
}
$(document).ready(function() {
$(".Designicon").click(function() {
toggleDetails("#designDetails", ".Designicon");
});
$("#designDetails").click(function() {
toggleDetails("#designDetails", ".Designicon");
});
$(".Developmenticon").click(function() {
toggleDetails("#developmentDetails", ".Developmenticon");
});
$("#developmentDetails").click(function() {
toggleDetails("#developmentDetails", ".Developmenticon");
});
$(".Managementicon").click(function() {
toggleDetails("#managementDetails", ".Managementicon");
});
$("#managementDetails").click(function() {
toggleDetails("#managementDetails", ".Managementicon");
});
for (let i = 1; i <= 8; i++) {
$(`#work${i}`).hover(function() {
$(`#workco${i}`).show();
}, function() {
$(`#workco${i}`).hide();
});
}
var myForm = document.getElementById("myForm");
myForm.addEventListener("submit", function(event) {
event.preventDefault(); // prevents the default form submission behavior
myFunction();
});
function myFunction() {
var username = document.getElementById("name");
var email = document.getElementById("email");
var message = document.getElementById("message");
if (!username.value || !email.value || !message.value) {
return false;
} else {
alert("Thank you " + username.value + " for reaching out. Message received.");
location.reload(); // reload the page
return true;
}
}
});