Can you please assist me in solving this problem by following this code snippet:
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.getElementById("name-page").style.width = "738px";
document.getElementById("news").style.marginLeft = "0";
document.getElementById("ida").style.marginLeft = "0";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
document.getElementById("name-page").style.width = "930px";
document.getElementById("news").style.marginLeft = "125px";
document.getElementById("ida").style.marginLeft = "125px";
}
The style of id=news
can be changed, but the style of id=ida
must remain constant. If written like this:
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.getElementById("name-page").style.width = "738px";
document.getElementById("ida").style.marginLeft = "0";
document.getElementById("news").style.marginLeft = "0";
}
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft= "0";
document.getElementById("name-page").style.width = "930px";
document.getElementById("ida").style.marginLeft = "125px";
document.getElementById("news").style.marginLeft = "125px";
}
The style for id=news
must not change, while the style for id=ida
is allowed to change.
I would greatly appreciate any help you can provide. Thank you for your understanding.