Results 1 to 3 of 3

Thread: Switch Content - noscript collapsed?

  1. #1
    Join Date
    Feb 2008
    Posts
    18
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Switch Content - noscript collapsed?

    1) Script Title: Switch Content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tchcontent.htm

    3) Describe problem: When loading the page without JavaScript enabled, all "hidden" blocks are revealed, as the script is designed to do. Is there something I can add or change so that a browser not running JavaScript will display none of the hidden blocks?

    Thanks!

  2. #2
    Join Date
    Aug 2004
    Posts
    9,902
    Thanks
    3
    Thanked 967 Times in 955 Posts
    Blog Entries
    15

    Default

    You can always manually add CSS that hides the expandable contents. Lets say you have the following two contents:

    Code:
    <h3 id="bobcontent1-title" class="handcursor">What is JavaScript?</h3>
    <div id="bobcontent1" class="switchgroup1">
    JavaScript is a scripting language originally developed by Netscape to add interactivity
    and power to web documents. It is purely client side, and runs completely on the client's browser and computer.
    </div>
    
    
    <h3 id="bobcontent2-title" class="handcursor">Difference between Java & JavaScript?</h3>
    <div id="bobcontent2" class="switchgroup1">
    Java is completely different from JavaScript.
    The former is a compiled language while the later is a scripting language.
    </div>
    Inside the HEAD section of your page, you'd target the "switchgroup1" class:

    Code:
    .switchgroup1{
    display:none;
    }
    DD Admin

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    StickBoy (09-03-2009)

  4. #3
    Join Date
    Feb 2008
    Posts
    18
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by ddadmin View Post
    You can always manually add CSS that hides the expandable contents.
    When I looked at this, it didn't make sense. How could it possibly work?

    Nevermind questioning it, just try it!

    I tried it and it worked.

    I don't know why it worked, but it did, and that's all I really care about!

    Thank you so much!

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
  •