PDA

View Full Version : Little Plus Minus Things


daveleeuk
05-21-2008, 12:02 PM
I have just made a help section for my website and it looks like too much text. I'm just wandering if it's possible to create those little plus minus things that expand/contract text in basic HTML (by basic HTML what i mean is no java or scripting stuff)

So the headers would be there with a little +/- next to them and people click them to show or hide the relevant text
TIA

Pegasus
05-21-2008, 12:47 PM
Those expanding/contracting menus are usually done with Javascript.

daveleeuk
05-22-2008, 04:20 AM
OK, is javascript very complex? would it involve messing with a javascript file thats already on the server or can i make a new one

EDIT: what is the 'proper' name for those menus

rangana
05-22-2008, 04:45 AM
You might find this code useful:

<script type="text/javascript">
window.onload=function()
{
var toggle=document.getElementById('toggle');
toggle.onclick=function()
{
var content=document.getElementById('content');
this.innerHTML=(this.innerHTML!='+')?'+':'-';
content.style.display=(content.style.display!='none')?'none':'';
}
}
</script>
<span id="toggle" style="cursor:pointer;">+</span>
<div id="content">
Whatever Contents Here
</div>

BonRouge
05-22-2008, 07:02 AM
See if this helps: http://bonrouge.com/togglescripts.php?script=byidtagandclass2