FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
javascript-basic-projects/5-sidebar/final/app.js at master · lajunta/javascript-basic-projects · GitHub
lajunta
javascript-basic-projects
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
javascript-basic-projects
/
5-sidebar
/
final
/
app.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (14 loc) · 536 Bytes
Breadcrumbs
javascript-basic-projects
/
5-sidebar
/
final
/
app.js
Copy path
File metadata and controls
16 lines (14 loc) · 536 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
const
toggleBtn
=
document
.
querySelector
(
".sidebar-toggle"
)
;
const
closeBtn
=
document
.
querySelector
(
".close-btn"
)
;
const
sidebar
=
document
.
querySelector
(
".sidebar"
)
;
toggleBtn
.
addEventListener
(
"click"
,
function
(
)
{
// if (sidebar.classList.contains("show-sidebar")) {
// sidebar.classList.remove("show-sidebar");
// } else {
// sidebar.classList.add("show-sidebar");
// }
sidebar
.
classList
.
toggle
(
"show-sidebar"
)
;
}
)
;
closeBtn
.
addEventListener
(
"click"
,
function
(
)
{
sidebar
.
classList
.
remove
(
"show-sidebar"
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL