FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
javascript-basic-projects/4-navbar/final/app.js at master · MaxCodeXTC/javascript-basic-projects · GitHub
MaxCodeXTC
javascript-basic-projects
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
javascript-basic-projects
/
4-navbar
/
final
/
app.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
20 lines (18 loc) · 660 Bytes
Breadcrumbs
javascript-basic-projects
/
4-navbar
/
final
/
app.js
Copy path
File metadata and controls
20 lines (18 loc) · 660 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// classList - shows/gets all classes
// contains - checks classList for specific class
// add - add class
// remove - remove class
// toggle - toggles class
const
navToggle
=
document
.
querySelector
(
".nav-toggle"
)
;
const
links
=
document
.
querySelector
(
".links"
)
;
navToggle
.
addEventListener
(
"click"
,
function
(
)
{
// console.log(links.classList);
// console.log(links.classList.contains("random"));
// console.log(links.classList.contains("links"));
// if (links.classList.contains("show-links")) {
// links.classList.remove("show-links");
// } else {
// links.classList.add("show-links");
// }
links
.
classList
.
toggle
(
"show-links"
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL