This is the javascript I use:
PHP Code:
function collapse_news(id)
{
var collapseText = document.getElementById('k' + id);
var collapseBild = document.getElementById('pic' + id);
if (collapseText.style.display == 'none') {
collapseText.style.display = 'block';
collapseBild.src = '/forums/images/buttons/collapse_alt.gif';
}
else {
collapseText.style.display = 'none';
collapseBild.src = '/forums/images/buttons/collapse_alt_collapsed.gif';
}
}
And then this:
PHP Code:
<a href="javascript:collapse_news('220')"><img border=0 src="/forums/images/buttonsttd/collapse_alt.gif" id=pic220 alt="Show / Hide"> Date and Title of my news</a><div id=k220 style="display: none;">My News Hidden</div>