Show / Hide Javascript

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Show / Hide Javascript

    I'm not to knowledgeable of Java and can't seem to get this script to show in
    the hidden state. I would like it to start with just the Expand showing. If
    anyone can help, I would appericate it . Thanks, Chris:confused;

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Open/Closed Box</title>
    <script type="text/javascript">
    function openClose(id) {
    var lnk=document.getElementById(id+"link");
    var box=document.getElementById(id+"content");
    if(box.style.display=="none") {
    box.style.display="block";
    lnk.firstChild.data="Close";
    } else {
    box.style.display="none";
    lnk.firstChild.data="Expand";
    }
    return false;
    }
    </script>
    </head>
    <body>

    <div id="box1" style="width:300px">
    <div id="box1title"><a href="#" id="box1link" onclick="return
    openClose('box1')">Close</a></div>
    <div id="box1content">
    This is the content for box1<br/>
    It should hide when you click the close link<br>
    This is a test <a href="http://www.google.com" target="_blank">LINK</a></p>
    </div>
    </div>
    &nbsp;
    <div id="box2" style="width:300px">
    <div id="box1title" style=""><a href="#" id="box2link" onclick="return
    openClose('box2')">Close</a></div>
    <div id="box2content">
    This is the content for box2<br/>
    It should hide when you click the close link<br>
    This is a test <a href="http://www.yahoo.com" target="_blank">LINK</a></div>
    </div>
    </div>
    </body>
    </html>

    Exador Guest

  2. Similar Questions and Discussions

    1. How to hide/show a group
      Hello, I created a group and added some children to it How can I show/hide the group with all children included? The group itself doesn't have...
    2. popup menus won't hide - PVII show/hide layers behaviour
      I've used the 'Auto show/hide by PVII" behaviour to create some popup menus for the navigation which make use of divs which appear and disappear....
    3. Show Hide javascript not working
      Can someone tell me what I am doing wrong??? Please help. <html> <head> <title>Untitled</title> <script language="JavaScript"> <!-- function...
    4. hide/show with mouseover
      I have page with all the medical terms. Instead of click on each term to show the definition, I want it to show when I have the mouseover on each...
    5. HIde/Show Templatecolumn
      Hi Guys, I have a templatecolumn that only has a edititemplate with a textbox, when not editing it must not be visible. Right now I set the...
  3. #2

    Default Re: Show / Hide Javascript

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Open/Closed Box</title>
    <script type="text/javascript">
    function openClose(id) {
    var lnk=document.getElementById(id+"link");
    var box=document.getElementById(id+"content");
    if(box.style.display=="none") {
    box.style.display="block";
    lnk.firstChild.data="Close";
    } else {
    box.style.display="none";
    lnk.firstChild.data="Expand";
    }
    return false;
    }
    </script>
    </head>
    <body>

    <div id="box1" style="width:300px">
    <div id="box1title"><a href="#" id="box1link" onclick="return
    openClose('box1')">Expand</a></div>
    <div id="box1content" style="display: none">
    This is the content for box1<br/>
    It should hide when you click the close link<br>
    This is a test <a href="http://www.google.com" target="_blank">LINK</a></p>
    </div>
    </div>
    &nbsp;
    <div id="box2" style="width:300px">
    <div id="box1title" style=""><a href="#" id="box2link" onclick="return
    openClose('box2')">Expand</a></div>
    <div id="box2content" style="display: none">
    This is the content for box2<br/>
    It should hide when you click the close link<br>
    This is a test <a href="http://www.yahoo.com" target="_blank">LINK</a></div>
    </div>
    </div>
    </body>
    </html>

    Php Cod3r Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139