My idea is to make a hamburger button with horizontal displacement and that is responsive. I currently have this, I do not have much knowledge, so I would like to know if someone can give me a hand with this menu. I want the menu to open with the hamburger icon, to the right and when the menu is already open, with the same hamburger icon clicking on the other part of the page it closes. This would be for when the page is being viewed on a computer or notebook.
When seen from a small device is the typical burger icon that displays downwards
function openNav() {
document.getElementById("mySidenav").style.width = "100%";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
}
.sidenav {
height: auto;
width: 0;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #111;
overflow-x: hidden;
transition: 0.5s;
display: block;
}
.sidenav a {
text-decoration: none;
font-size: 25px;
color: #818181;
transition: 0.5s;
}
.sidenav a:hover, .offcanvas a:focus{
color: #f1f1f1;
}
@media (max-width: 4000px){
.sidenav .row{
height: 60px;
}
}
@media (max-width: 1000px){
.sidenav .row{
height: auto;
vertical-align: center;
}
}
.sidenav {
height: auto;
text-align: center;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"> <!-- boostrap-->
<link rel="stylesheet" type="text/css" href="css/personalstyle.css"> <!--estilo personal -->
<span style="font-size:25px;cursor:pointer" onclick="openNav()">☰ MENU</span>
<div id="mySidenav" class="sidenav row">
<div class="col-md-2"><a href="javascript:void(0)" class="closebtn" onclick="closeNav()">☰MENU</a></div>
<div class="col-md-2"><a href="#servicesection">SERVICIOS</a></div>
<div class="col-md-2"><a href="#clientessection">CLIENTES</a></div>
<div class="col-md-2"><a href="#biografiasection">BIO</a></div>
<div class="col-md-2"><a href="#contactosection">CONTACTO</a></div>
<div class="col-md-2"><a href="Index/EN.html">English</a></div>
</div>