Sorry for the delay. If I understand you correctly, you want to create a single link that mass toggles the states of multiple DIVs when clicked on. If so, try adding the below script to the HEAD section of your page:
Code:
<script type="text/javascript">
function masstoggle(link, dividsarr){
var $div1=jQuery('#'+dividsarr[0])
var img=jQuery(link).find('img:eq(0)').get(0)
if ($div1.css('display')=="block"){ //collapse all?
animatedcollapse.hide(dividsarr)
img.src="expand.jpg"
}
else{ //expand all?
animatedcollapse.show(dividsarr)
img.src="collapse.jpg"
}
}
</script>
Change "expand.jpg" and "collapse.jpg" above to the paths of your own images. Then define a link that calls this function:
Code:
<a href="#" onClick="masstoggle(this, List_of_ids_array); return false"><img src="expand.jpg" /></a>
Where "List_of_ids_array" is an array of IDs corrsponding to the DIVs you wish to expand/collapse all at once, for example:
Code:
<a href="#" onClick="masstoggle(this, ['jason', 'kelly', 'michael']); return false"><img src="expand.jpg" /></a>
Bookmarks