1
I’m trying to make a Side Navigation
, so in Internet search, I found a little tutorial on the site: How TO - Side Navigation
However, in my example I wanted a single button to open and close, so I made the following modifications:
function closeNav()
{
if (document.getElementById("mySidenav").style.width < 250)
{
document.getElementById("mySidenav").style.width = "250px";
}
else
{
document.getElementById("mySidenav").style.width = "40px";
}
}
But, it only works once, IE, it opens and closes then no longer works.
Where is there Java there?
– Jéf Bueno
You can make an example in Jsfiddle?
– BrTkCa
Never make the side-Nav appear and disappear by changing the width, use Transform’s translateX css. When you change the width you generate several expensive Paints that are made by the CPU, if you use translateX you will have extremely light Paints run by GPU.
– MarioAleo