Hi thanks for looking.
It's quite straight forward really. As opposed to allowing all possible divs to be displayed I would like to make them all collapse and then only expand the one that the user clicked on. Simple right?
OK so here is my code right now, which allows them all to be displayed.
function ShowHide(div){
if (document.getElementById(div).style.display == 'none' ){
document.getElementById(div).style.display = 'block';
}
else if ( document.getElementById(div).style.display == 'inline-block' ){
document.getElementById(div).style.display = 'none';
}
else
{
document.getElementById(div).style.display = 'none';
}
}
However when I add the following function below the above one and call it instead it doesn't even expand the div tag.
function toggleSlide(objname) {
var f=2005;
for (f=2005;f<=2025;f++)
{
document.getElementById(f).style.display = 'none';
}
ShowHide(objname);
}
The f var is to cycle through all the id's. The id is generated by PHP on the server side. Then I simple call the first function that I know works by itself.
Any help at all is greatly appreciated.