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?

jsfiddle

<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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -