-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
51 lines (41 loc) · 1.32 KB
/
main.js
File metadata and controls
51 lines (41 loc) · 1.32 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
//Sign up button!
//Watch the button. Wait for a click
document.querySelector('#show-hide-textbox').addEventListener('click', showForm)
//Hide element on page load
document.getElementById('email-form').hidden = true;
//When the button is clicked, hide the button and show the form
function showForm() {
document.getElementById('email-form').hidden = false;
document.getElementById('show-hide-textbox').hidden = true;
}
//======================================================================
//Smooth Scrolling
function scrollFunction1() {
let e = document.getElementById('section1');
e.scrollIntoView({
block: 'start',
behavior: 'smooth',
inline: 'start'
});
}
function scrollFunction2() {
let e = document.getElementById('section2');
// This ends the block to the window
// bottom and also aligns the view to the center
e.scrollIntoView({
block: 'end',
behavior: 'smooth',
inline: 'center'
});
}
function scrollFunction3() {
let e = document.getElementById('section3');
// This ends the block to the window
// bottom and also aligns the view to the center
e.scrollIntoView({
block: 'end',
behavior: 'smooth',
inline: 'center'
});
}
//======================================================================