Results 1 to 4 of 4

Thread: On click description?

  1. #1
    Join Date
    Jan 2007
    Posts
    181
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default On click description?

    Looking for a script that works something like..

    When you click on a link, words drop down under it... something like "read more" and then when you click it, a description would drop under it.

    Thanks!!
    Last edited by Jon101; 05-07-2007 at 07:14 PM.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    In the had of the document, place this:

    Code:
    <script type="text/javascript">
    
    function showHide(item) {
     var obj = document.getElementById(item);
    
       if (obj.style.display == "none") {
         obj.style.display = 'block';
       }
    
       else {
         obj.style.display = 'none';
       }
    }
    </script>
    Then in the body of the page (where you want the div to show up), place this:

    Code:
    <a href="index.html" onclick="showHide('theDiv'); return false;">Show/Hide Div</a>
    
    <div id="theDiv" style="display: none;">Text that is hidden until the above link is clicked.</div>
    Hope this helps to get you started.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Jan 2007
    Posts
    181
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default

    Thanks for the response. I'll check it out as soon as I can.

  4. #4
    Join Date
    Jan 2007
    Posts
    181
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default

    Works like a charm!!
    Thanks!!

Bookmarks

Posting Permissions

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