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
    Apr 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    quikie: where to find script

    hi, just a quick one! i'm after a simple script that 'toggles' show/hide more info on a page as can be seen here (click the link "more information").

    i've searched the readymadeJava page and have had no luck, but i'm pretty sure i've seen it here a while back, if i'm not mistaken? cant seem to find it anymore

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Basic idea:

    Code:
    function toggleDisplayInfo(id){
      document.getElementById(id).style.display = (document.getElementById(id).style.display == "block")?"none":"block";
    }
    Code:
    <a href="#" onclick="toggleDisplayInfo('someid');return false;">Show/Hide</a>
    <div id="someid" style="display:none;">asdf</div>
    fyi: untested and typed here,
    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

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