Ok, script updated to resolve the issue with the current content not being able to be explicitly closed. Replace function sweeptoogle() and expandcontent() in the original script with the below versions instead:
Code:
function sweeptoggle(ec, optignore){
var inc=0
while (ccollect[inc]){
if (!(typeof optignore!="undefined" && ccollect[inc].id==optignore))
ccollect[inc].style.display=(ec=="contract")? "none" : ""
inc++
}
revivestatus()
}
function expandcontent(curobj, cid){
sweeptoggle("contract", cid)
if (ccollect.length>0){
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="none")? "none" : ""
curobj.src=(document.getElementById(cid).style.display=="none")? expandsymbol : contractsymbol
}
}
The parts in red are new (from the original code). To summarize again, the above changes will cause the script to only open one switch content at any given time (closing the rest). The target switch content can still be closed or open as desired.
Bookmarks