the javascript
Code:
function blockswitch(bid) {
var bpe = document.getElementById('pe'+bid);
var bico = document.getElementById('pic'+bid);
if (bpe && bpe.style.display=="none") {
bpe.style.display="";
bico.src = bico.src.replace("plus.", "minus.");
} elseif (bpe) {
bpe.style.display="none"; }
bico.src = bico.src.replace("minus.", "plus.");
}
} the html image which controls the div
Code:
<img alt="Toggle Content" title="Toggle Content" id="pic1" src="minus.gif" onclick="blockswitch('1');" style="cursor:pointer" /> the actual div
Code:
<div id="pe1">
<!-- CONTENT HERE -->
</div> change the '1' in "pic1", "pe1" and blockswitch('1') to anything you like.
"minus.gif" gets replaced by "plus.gif" if you click on the image.
document.getElementById() is supported by IE and FireFox.