function showHide(button, div){
var buttonobj = document.getElementById(button);
var divobj = document.getElementById(div);
var plusregexp = /.*plus\.gif$/;
var minusregexp = /.*minus\.gif$/;
var isPlusButton = buttonobj.src.search(plusregexp);
var isMinusButton = buttonobj.src.search(minusregexp);
// show div
if( isPlusButton == 0 ){
divobj.style.display = "block";
buttonobj.src = "minus.gif";
buttonobj.alt = "-";
}
// hide div
else if( isMinusButton == 0 ){
divobj.style.display = "none";
buttonobj.src = "plus.gif";
buttonobj.alt = "+";
}
}
No replies to this topic
#1
Posted 10 December 2009 - 06:38 AM
I'm doing a web site for one of my college classes, and I created a neat script for the main menu. Each menu item has a plus/minus button next to it. When you click the button, a menu appears or disappears below it. It's a pretty simple script. I just thought I might share some of my website, because I'm working really hard on it.
Life's too short to be cool. Be a nerd.
|
|
|
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









