forked from facn5/shajaraWebSolutions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
51 lines (40 loc) · 1.24 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
function biograph(element) {
if(element.className == 'about__slot') {
element.className = 'about__slot bio';
}
else {
element.className = 'about__slot';
}
}
document.addEventListener('DOMContentLoaded', function() {
var phoneID = document.getElementById('phoneNumber')
var phoneLabelID = document.getElementById('phoneNumberLabel')
phoneID.addEventListener('focusin', function() {
phoneID.placeholder = "050 555 5555"
phoneLabelID.innerText = "What is your phone number? (555 555 5555)"
}, true);
phoneID.addEventListener('focusout', function() {
phoneID.placeholder = ""
phoneLabelID.innerText = "What is your phone number?"
}, false);
window.onscroll = function() {
onScrollShowNavBar()
};
function clearForm() {
document.getElementById("mytext").value = ""
document.getElementById("myemail").value = ""
document.getElementById("phoneNumber").value = ""
}
var navbar = document.getElementById("about-us");
var navbar1 = document.getElementById("navbar");
var sticky = navbar.offsetTop;
function onScrollShowNavBar() {
if (window.pageYOffset >= sticky) {
navbar1.style.display = "block"
navbar1.classList.add("sticky")
} else {
navbar1.classList.remove("sticky");
navbar1.style.display = "none"
}
}
})