I've got a bit of javascript on my page:
function expandIt(BlockName) {
img = eval('document.img_'+BlockName);
x=img.src;
if (document.getElementById(BlockName).style.display == "block") {
document.getElementById(BlockName).style.display = "none";
if (x.substring(x.length-8,x.length) == "down.gif") img.src = "menu_up.gif";
else img.src = "menu_down.gif"
} else {
document.getElementById(BlockName).style.display = "block";
if (x.substring(x.length-6,x.length) == "up.gif") img.src = "menu_down.gif";
else img.src = "menu_up.gif";
}
}
which displays hidden div's that i've got on the page top make them expand:
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onClick="expandIt('block01'); return false;" class="modulelink">
<img name="img_block01" src=http://www.webdeveloper.com/forum/archive/index.php/"menu_down.gif" border="0" alt="Expand/Collapse Item" height="12" width="17" align="top">
Projects</a></h1>
<DIV ID="block01" style="display:none">
<div class="subsection">
<p><a href="#">Meeting Minutes</a></p>
<p><a href="#">Project Directories</a></p>
</DIV>
etc (I have about 5 of these, all with different ID's in the div's). What I'm wondering is is there a way I can make them all expand right through the page? I thought about a loop of sorts, but i was just wondering if there was some javascript that i could use that would automatically show all the hidden div's, without having to loop through all the different id's.
Sorry if that doesnt make much sense, and thanks in advance for assistance!
function expandIt(BlockName) {
img = eval('document.img_'+BlockName);
x=img.src;
if (document.getElementById(BlockName).style.display == "block") {
document.getElementById(BlockName).style.display = "none";
if (x.substring(x.length-8,x.length) == "down.gif") img.src = "menu_up.gif";
else img.src = "menu_down.gif"
} else {
document.getElementById(BlockName).style.display = "block";
if (x.substring(x.length-6,x.length) == "up.gif") img.src = "menu_down.gif";
else img.src = "menu_up.gif";
}
}
which displays hidden div's that i've got on the page top make them expand:
<a href=http://www.webdeveloper.com/forum/archive/index.php/"#" onClick="expandIt('block01'); return false;" class="modulelink">
<img name="img_block01" src=http://www.webdeveloper.com/forum/archive/index.php/"menu_down.gif" border="0" alt="Expand/Collapse Item" height="12" width="17" align="top">
Projects</a></h1>
<DIV ID="block01" style="display:none">
<div class="subsection">
<p><a href="#">Meeting Minutes</a></p>
<p><a href="#">Project Directories</a></p>
</DIV>
etc (I have about 5 of these, all with different ID's in the div's). What I'm wondering is is there a way I can make them all expand right through the page? I thought about a loop of sorts, but i was just wondering if there was some javascript that i could use that would automatically show all the hidden div's, without having to loop through all the different id's.
Sorry if that doesnt make much sense, and thanks in advance for assistance!