I really wanted an expand/contract all that is client side. This will not hold state when moving from page to page.
Note that the object I am referencing to get the DIV collection has the id of "tblResults". You will have to modify the "postbit" tempate and add a name to the parent table that encapsules all of the threads.
id="tblResults"
JavaScript Code
[QUOTE]
<script language="JavaScript" type="text/javascript">
<!--
function ExpandAll(){
var objDivs = tblResults.all.tags("DIV");
for(i = 0; i < objDivs.length; i++){
if (objDivs(i).style.display=="none") {
objDivs(i).style.display="";
}else {
objDivs(i).style.display="none";
}
}
}
function ContractAll(){
var objDivs = tblResults.all.tags("DIV");
for(i = 0; i < objDivs.length; i++){
if (objDivs(i).style.display=="show" || objDivs(i).style.display=="") {
objDivs(i).style.display="none";
}else {
objDivs(i).style.display="";
}
}
}
</script>
|