I've got a sliding panel which I want to hide in push.
Now I've got two links, one for show and another for hide:
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
}
How can I do it in one function ?