Home › Forums › JavaScript › Query: JS style.height IF statement › Re: Query: JS style.height IF statement
July 17, 2013 at 8:46 am
#143310
Participant
:P here it works, change only if statment
function expandNav()
{
var nav = document.getElementById(“navBar”);
if (nav.style.height == “150px”)
{
nav.style.height = “31px”;
}
else
{
nav.style.height = “150px”;
}
}
problem was that after first clicking we assign height to 31px , but it already was 31px and seems that nothing happens