Hello I'm trying to do a show hide div function that will hide the last open div and will open the new one
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 oneCode:<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>
someone suggested me to use this
but I'm not really sure how to use it , can someone help me please.Code:if (previousD != null) { HideContent(previousD); } previousD = d;
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.



Reply With Quote


Bookmarks