Вы можете использовать медиа-запросы для достижения этой цели. Быстрый пример с медиа-запросами и немного JS. Рабочая скрипка там .
HTML:
<div class="triggers">
<div class="trigger"></div>
<div class="trigger"></div>
</div>
<nav>
<a href="#">link</a>
<a href="#">link</a>
<a href="#">link</a>
</nav>
<h1>
Resize under 720px
</h1>
CSS:
html {
font-family: sans-serif;
}
h1 {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
}
nav {
position: fixed;
top: 0; left: 0; right: 0;
height: 50px;
display: flex;
justify-content: center;
align-items: center;
transition: all .25s ease;
}
.triggers {
display: none;
position: fixed;
top: 10px; right: 25px;
width: 50px;
height: 50px;
justify-content: center;
align-items: center;
z-index: 99;
}
.trigger {
position: absolute;
width: 30px;
height: 2px;
background: #000;
transition: all .25s ease;
}
.trigger:nth-child(1).is-active {
transform: rotate(45deg);
}
.trigger:nth-child(2).is-active {
transform: rotate(-45deg);
}
a {
text-decoration: none;
margin: 10px;
}
@media (max-width:720px) {
.triggers {
display: flex;
}
nav {
top: -50px;
}
nav.is-active {
top: 0;
}
}
JS (jQuery):
$(function(){
$('.triggers').click(function(){
$('.trigger, nav').toggleClass('is-active');
});
});