Skip to content

Commit

Permalink
Fix burger button for RWD...
Browse files Browse the repository at this point in the history
  • Loading branch information
haceneouserir committed Jan 16, 2022
1 parent 01f02f0 commit 6b97b41
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ header {
/* Hide the icon of small screens */
.navbar .icon {
display: none;
cursor: pointer;
}

/* Style multi sections & footer */
Expand Down
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<a class="item" href="#services">Services</a>
<a class="item" href="#review">Review</a>
<a class="item" href="#contact-me">Contact Me</a>
<a href="javascript:void(0);" class="icon" onclick="myFunction()">
<a class="icon">
<i class="bi bi-list"></i>
</a>
</nav>
Expand Down Expand Up @@ -145,6 +145,8 @@ <h2 class="title-2">Contact Me</h2>
</div>
</footer>
<!-- End Footer -->
<!-- JQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<!-- JS -->
<script src="js/app.js" defer></script>
</body>
Expand Down
20 changes: 12 additions & 8 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ function backToTop() {
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}

function myFunction() {
var nav = document.getElementById("myTopnav");
if (nav.className === "navbar") {
nav.className += " responsive";
} else {
nav.className = "navbar";
}
}
// function myFunction() {
// var nav = document.getElementById("myTopnav");
// if (nav.className === "navbar") {
// nav.className += " responsive";
// } else {
// nav.className = "navbar";
// }
// }

$('.icon').click(function () {
$('#myTopnav').toggleClass('responsive');
});

0 comments on commit 6b97b41

Please sign in to comment.