Created
June 15, 2010 17:52
-
-
Save cfaulkingham/439428 to your computer and use it in GitHub Desktop.
expandCollapse() code from Scripoting News
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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