fredboniface.co.uk/js/navbar.js

9 lines
289 B
JavaScript
Raw Normal View History

2022-10-07 19:46:11 +01:00
/* Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon */
function hamburger() {
2022-10-07 20:14:11 +01:00
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
2022-10-07 19:46:11 +01:00
x.className += " responsive";
} else {
2022-10-07 20:14:11 +01:00
x.className = "topnav";
2022-10-07 19:46:11 +01:00
}
2022-10-07 20:14:11 +01:00
}