Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    show/hide question

    Code:
    <script>
    <!--
    var state = 'none';
    
    function showhide(layer_ref) {
    
    if (state == 'block') {
    state = 'none';
    }
    else {
    state = 'block';
    }
    if (document.all) { //IS IE 4 or 5 (or 6 beta)
    eval( "document.all." + layer_ref + ".style.display = state");
    }
    if (document.layers) { //IS NETSCAPE 4 or below
    document.layers[layer_ref].display = state;
    }
    if (document.getElementById && !document.all) {
    maxwell_smart = document.getElementById(layer_ref);
    maxwell_smart.style.display = state;
    }
    }
    //-->
    </script>
    and

    Code:
    <a href="#" onclick="showhide('stuff');">Stuff</a>
    
    <div id="stuff" style="display: block;">
                     <a href="blah.aspx">Menu Stuff</a>
                     <br /><a href="blah.aspx">Menu Stuff</a>
                      </div>
    Is there a way for the menu to stay open once some clicked on a "Menu Stuff" link and is transported to that page?

    Thanks in advance.

  • #2
    Regular Coder feras_wilson's Avatar
    Join Date
    Jul 2005
    Location
    Sweden
    Posts
    129
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up This it the code

    Code:
    <head>
    <meta http-equiv="Content-Language" content="sv">
    <script>
    function showhide() {
    if(mylayer.style.visibility=='hidden')
    mylayer.style.visibility='visible'
    else
    mylayer.style.visibility='hidden'
    }
    </script>
    </head>
    
    <div style="position: absolute; width: 158px; height: 100px; z-index: 1; left: 47px; top: 90px" id="mylayer">
    	This is the layer!!</div>
    <p><a href="#" onclick="showhide()">Show/hide layer</a></p>
    This works
    Exp:
    PHP
    .NET


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •