Collapse and Expand

<!-- This is the Activator -->
<span style="cursor:pointer; text-decoration:underline; color:#69F;" onclick="javascript: expandCollapse('div_to_expand');">Click to Expand or Collapse</span>

<!-- This the div to expand and collapse -->
<div id="div_to_expand" style="display:none; background-color:#69F; height:100px">Content for the Div</div>

<script language="javascript">
function expandCollapse() {
for (var i=0; i<expandCollapse.arguments.length; i++) {
var element = document.getElementById(expandCollapse.arguments[i]);
element.style.display = (element.style.display == "none") ? "block" : "none";
}
}
</script>

0 Comments

You must be logged in to post a comment.