javascript - make expand all into collapse one button -
i beginner in javascript , found difficult enable toggle function expand , collapse 1 button
please can me out jsfiddle example?
<div id="sidetreecontrol"><a href="?#">collapse all</a> | <a href="?#">expand all</a>
thanks
add third link in #sidetreecontrol
"toggle" control:
<div id="sidetreecontrol"> <a href="#">collapse all</a> | <a href="#">expand all</a> | <a href="#">toggle all</a> </div>
demo: http://jsfiddle.net/dtxjt/1/
if don't want collapse all
, expand all
links, hide them css:
<div id="sidetreecontrol"> <a href="#" class="hidden">collapse all</a> <a href="#" class="hidden">expand all</a> <a href="#">toggle all</a> </div>
where:
.hidden {display: none;}
demo: http://jsfiddle.net/dtxjt/2/
i couldn't find options documentation plugin you're using, otherwise i'd link it.
Comments
Post a Comment