Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Query: JS style.height IF statement Re: Query: JS style.height IF statement

#143310
Kuzyo
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