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


I’ve noticed a slight issue. I can’t see any problems in the JavaScript. I mean, it’s fairly simple and logical.

In the navigation bar, within HTML document, there is an `` element that has an `onclick=”expandNav()”` property. When you click on the image it will call the “expandNav()” function and the navigation bar will expand. Click on it again and it will collapse.

However, on page load, the first click on the image doesn’t seem to be registered. I have to click it twice initially to get the navigation bar to expand. Then, after that, only single clicks to collapse or expand the navigation bar.

Is there any obvious reason for this?