This is used more and more to display more info, hidden fields, etc…
It could easily be improved with multiple divs stacked in the same place…
Hmmm…, now I am getting ideas.
function openCloseDiv( elementId ){
var element = document.getElementById(elementId);
if ( element.style.display == 'block' ) {
element.style.display = 'none';
} else {
element.style.display = 'block';
}
} |
OK, Thats the function set up. Store this in javscript.js or something simillar…
<span title="Click here to display info..." onclick="openCloseDiv( 'DIVNAME' )"> Blah Blah.... </span> <div id="DIVNAME" style="display: none;"> // or when open, "display: block;" ---DIV CONTENTS---</div> |
Write a Comment
Let me know what you think?