How to make the following slidein navigation bar? Is it possible without using any plugins and just stick with CSS3?
No plugins, very simple markup, css transitions, and a few lines of javascript
#menu{
height:100%;
transition:1s;
width:200px;
margin-left:-200px;
}
button{
position:absolute;
right:-30px;
}
Javascript:
var open = document.getElementById('open')
var menu = document.getElementById('menu')
open.addEventListener('click',openit,false);
var i = 0;
function openit(){
if(i==0){
menu.style.marginLeft= "0px"
i=1
}
else{
menu.style.marginLeft= "-200px"
i=0
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.