Reputation: 10254
Hello I have a bullet tree that toggles fine, but I wanted to do a one of those sliding toggles that look pretty in jquery...can you help?
javascript:
function toggle(id) {
var e = document.getElementById(id);
if (e.style.display == '')
e.style.display = 'none';
else
e.style.display = '';
}
html:
<ul style="text-align: left;">
<li>
<a href="#" onclick="toggle('node1')">All</a> <input type="checkbox" name="sors" value="A" checked="checked"/>
<ul id="node1" style="display:none">
<li>
<a href="#" onclick="toggle('node2')">Organic</a>
<ul id="node2" style="display:none">
<li>MCA <input type="checkbox" name="sors" value="A" checked="checked"/></li>
<li>MCB <input type="checkbox" name="sors" value="A" checked="checked"/></li>
</ul>
</li>
<li>COMM <input type="checkbox" name="sors" value="A" checked="checked"/></li>
<li>DMISA <input type="checkbox" name="sors" value="A" checked="checked"/></li>
</ul>
</li>
</ul>
Upvotes: 0
Views: 720
Reputation: 23655
See jquery's show
and hide
functions. You can pass them a value in milliseconds to animate the showing/hiding.
Upvotes: 0