I am looking for a show/hide script. I have found a lot of scripts but I am looking for one where not only a text link, but a picture as well is clickable.
The picture should change when clicked down, for example an arrow pointing down when the div is hidden en pointing up when the div is showed.
-I would like to place text next to the image, so that the text as well as the image is clickable to show the div
-How do I change the code so that by default the hidden div is not showing?
Sometimes you may want to hide several things and show one.
Here is a script I use to hide everything and then show the one thing I want to display. So whether it is hide 1 and show 1 or hide many and show 1 this should work. One thing I like to do is to set all the div names into a variable and have it in the link like this:
function HideNShow (HideThese, ShowThis)
{
var temp = (HideThese);
var temparray = new Array();
temparray = temp.split(', ');
var arLen=temparray.length;
for ( var i=0, len=arLen; i<len; ++i ){
var ele = document.getElementById(temparray[i]);
ele.style.display = "none";
}
document.getElementById(ShowThis).style.display='block';
}
Last edited by kevhouston740; 06-14-2012 at 01:35 PM.
Reason: clarification
Bookmarks