Subscribe to Collegiate Chronicles        RSS Feed
-----

Collapsing Sections

Icon Leave Comment
This technique uses HTML and Javascript.

The code:

Javascript (in your header or an external file):
<script type="text/javascript">
function toggleDiv(divid){
	if(document.getElementById(divid).style.display == 'none'){
	  document.getElementById(divid).style.display = 'block';
	}else{
	  document.getElementById(divid).style.display = 'none';
	}
  }
</script>



HTML:
<a href="java script:;" onmousedown="toggleDiv('mydiv');">Click here for more info!</a><br />
<div id="mydiv" style="display:none">
Here's the hidden text!
</div>



See it in action here!

0 Comments On This Entry

 

April 2019

S M T W T F S
 123456
78910111213
14151617181920
21 22 2324252627
282930    

Recent Entries

Recent Comments

Search My Blog

0 user(s) viewing

0 Guests
0 member(s)
0 anonymous member(s)