flash
12-24-2007, 07:37 PM
Hello I'm trying to do a show hide div function that will hide the last open div and will open the new one
<script type="text/Javascript">
function HideContent(d) {document.getElementById(d).style.display = "none";}
function ShowContent(d) {document.getElementById(d).style.display = "";}
function ReverseContentDisplay(d)
{if(document.getElementById(d).style.display == "none") {
document.getElementById(d).style.display = "";
}else { document.getElementById(d).style.display = "none"; }}
</script>
I got this function that works for hiding and showing div but it doesnt hide the last div when a new one is open instead opens a new one
someone suggested me to use this
if (previousD != null) { HideContent(previousD); }
previousD = d;
but I'm not really sure how to use it , can someone help me please.
I'm using javascript:ReverseContentDisplay('number') to show/hide the div i'm not sure if/how i should use HideContent/ShowContent functions too.
help please.
<script type="text/Javascript">
function HideContent(d) {document.getElementById(d).style.display = "none";}
function ShowContent(d) {document.getElementById(d).style.display = "";}
function ReverseContentDisplay(d)
{if(document.getElementById(d).style.display == "none") {
document.getElementById(d).style.display = "";
}else { document.getElementById(d).style.display = "none"; }}
</script>
I got this function that works for hiding and showing div but it doesnt hide the last div when a new one is open instead opens a new one
someone suggested me to use this
if (previousD != null) { HideContent(previousD); }
previousD = d;
but I'm not really sure how to use it , can someone help me please.
I'm using javascript:ReverseContentDisplay('number') to show/hide the div i'm not sure if/how i should use HideContent/ShowContent functions too.
help please.