Skip to content

Instantly share code, notes, and snippets.

@cfaulkingham
Created June 15, 2010 17:52
Show Gist options
  • Save cfaulkingham/439428 to your computer and use it in GitHub Desktop.
Save cfaulkingham/439428 to your computer and use it in GitHub Desktop.
expandCollapse() code from Scripoting News
function expandCollapse(id){
var imgId = 'img_'+ id;
if(document.getElementById(id).className == 'hide'){
document.getElementById(id).className='show';
// This will allow the window to scroll to the expanded text
//
window.location.href = "#"+id;
document.getElementById(imgId).src='http://scripting.com/mktree/minus.gif';
}
else{
document.getElementById(id).className='hide';
document.getElementById(imgId).src='http://scripting.com/mktree/plus.gif';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment