Answer the question
In order to leave comments, you need to log in
How to make smooth animation for JS menu?
Good day. There is a JS code that, when clicked, opens the menu, and when the button is clicked again, closes it.
function openbox(id){
display = document.getElementById(id).style.display;
if(display=='none'){
document.getElementById(id).style.display='block';
}else{
document.getElementById(id).style.display='none';
}
}
Answer the question
In order to leave comments, you need to log in
Make it a rule to write the whole example at once on jsfiddle.net or similar resources.
Here is the pure js code , css3
animation with js animation is faster to do with jQuery
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question