CSS make hidden layer visible with click

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gammajonny
    New Member
    • Jun 2006
    • 1

    CSS make hidden layer visible with click

    Im 14 yrs old and just make web sites for fun really, i use html css and java script at the moment but im just starting java. I live in Exeter in the uk. That me basicly.


    My first question is-

    Using css I've made a visible and hidden layer. Using Js i want to make the hidden layer visible by clicking on the visible layer.

    I have tryed this:
    <div id="box1" <a href="javascrip t:showLayer('bo x5');">
    <span class="1"><cent er>Places to go</center></span>
    </div> </a>

    Box5 being the hidden box.

    Any replises will be much appreichated and im sorry if this seems really simple.
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    Code:
    <script>
    function swapform() {
    	var visable
    	var hidden
    	visable = document.getElementById("visible").innerHTML;
    	hidden = document.getElementById("theform").innerHTML;
    	document.getElementById("visible").innerHTML = hidden;
    }
    </script>
    
    <div id="visible">
    <input type="button" value="change form" onclick="swapform();">
    </div>
    
    
    <div id="theform" style="visibility: hidden">
    <form action="blah.asp" method="post">
    <table>
    <tr><td><input type="text" value="Insert Name">
    <tr><Td><input type="submit" value="rub a dub">
    </table>
    </form>
    </div>
    this is how i would do it..... i answered a very similar question under javascript on this site so hopefully this same code i made for him will help you good luck and if you have any questions about this let me know.

    Comment

    Working...