My problem is that when onclick
triggers the toggleNew
function it\'s not executing but when I click the div
a second time it\'s execut
This will not work properly because you are using following line inside 'div#aside_main' which is going to be hidden.
click
Try keeping it outside like this-
click
content
content2
Also in javascript it is not checking for 'e.style.display' first time in if condition.
Try using
if(e.offsetWidth > 0 || e.offsetHeight > 0){
e.style.display = 'none';
se.style.display = 'block';
}
else
{
e.style.display = 'block';
se.style.display = 'none';
}