Wednesday, March 31, 2010

It's a quite simple toggling script

I feel this would be a better way to hide and show the content. Go through the following script.

Here,
sm is the id which one you want hide and show.

call the function "togglesm()".


function togglesm() {
var state = document.getElementById('sm').style.display;
if (state == 'block') {
document.getElementById('sm').style.display = 'none';
} else {
document.getElementById('sm').style.display = 'block';

}
}


You can suggest or feedback ... thanks

No comments: