File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626 < a class ="navbar-brand " href ="# ">
2727 < img class ="logo-icon " src ="./img/logo/ambyrdevelops.ico " alt ="Ambyr Develops icon " />
2828 </ a >
29- < button class ="navbar-toggler nav-link " type ="button " data-bs-toggle ="collapse " data-bs-target ="#navbarText " aria-controls ="navbarText " aria-expanded ="false " aria-label ="Toggle navigation ">
29+ < button class ="navbar-toggler " type ="button " data-bs-toggle ="collapse " data-bs-target ="#navbarText " aria-controls ="navbarText " aria-expanded ="false " aria-label ="Toggle navigation ">
3030 < span class ="navbar-toggler-icon "> </ span >
3131 </ button >
3232 < div class ="navbar-collapse collapse " id ="navbarText ">
@@ -320,7 +320,4 @@ <h3>Running a marathon isn't easy</h3>
320320 </ body >
321321 < script src ="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js " integrity ="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL " crossorigin ="anonymous "> </ script >
322322 < script src ="./js/index.js "> </ script >
323- < script >
324- initializeNavbarCollapse ( ) ;
325- </ script >
326323</ html >
Original file line number Diff line number Diff line change @@ -4,6 +4,19 @@ function initializeNavbarCollapse() {
44 const navLinks = document . querySelectorAll ( '.nav-link' ) ; // Select all nav links
55 const navbarCollapse = document . querySelector ( '.navbar-collapse' ) ; // Select the collapse element
66
7+ // Show/hide functionality for the button
8+ if ( toggleButton && navbarCollapse ) {
9+ toggleButton . addEventListener ( 'click' , ( ) => {
10+ if ( navbarCollapse . classList . contains ( 'show' ) ) {
11+ // Close the navbar
12+ navbarCollapse . classList . remove ( 'show' ) ;
13+ } else {
14+ // Open the navbar
15+ navbarCollapse . classList . add ( 'show' ) ;
16+ }
17+ } ) ;
18+ }
19+
720 navLinks . forEach ( link => {
821 link . addEventListener ( 'click' , ( ) => {
922 if ( navbarCollapse . classList . contains ( 'show' ) ) {
@@ -14,3 +27,6 @@ function initializeNavbarCollapse() {
1427 } ) ;
1528 } ) ;
1629}
30+
31+ // Call the function to initialize functionality
32+ initializeNavbarCollapse ( ) ;
Original file line number Diff line number Diff line change 22 "name" : " Ambyr Develops" ,
33 "email" : " ambyr.develops@gmail.com" ,
44 "homepage" : " https://ambyrdevelops.github.io" ,
5- "version" : " 2.0.6 " ,
5+ "version" : " 2.0.7 " ,
66 "description" : " " ,
77 "main" : " index.js" ,
88 "scripts" : {
You can’t perform that action at this time.
0 commit comments