I'm making an effect for MENU using CSS and jQuery.
Problem
transition
works from the element itself with hover
action. Home
The reverse does not work.
The CSS below does the following:
You have a Mobile MENU hidden to the left of the site. And when I use a jQuery function to call the .showMenu
class, the MENU runs to the left:0
position. But when I click back on the button that executes the jQuery function, the MENU does not return the same way it came - running.
The MENU simply disappears.
// CSS
nav#menu-navigation{
position:fixed;
background-color: #FFF;
width: 80%;
max-width: 256px;
height: 70%;
top: 0;
left: -400px;
bottom: 20px;
margin: auto;
overflow: auto;
transition: left 0.3s ease;
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
&.show-menu{
left: 0px;
z-index: 1;
transition: left 0.3s ease;
}
}
// jQuery
$(document).ready(function(){
$('.open-menu').on('click tap', function(){
$('nav#menu-navigation, main').toggleClass('show-menu');
});
});