Results 1 to 3 of 3

Thread: Open default

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

    Default Open default

    1) Script Title: Switch Content

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

    3) Describe problem:
    I have a load of content being generated dynamically via a database.
    Everything about the script and the functionalitys work fine /Except/ trying to get the default open state to work.

    http://89.234.34.130/news.php

    I tried to have it work out dynamically but that didn't work so have resorted for the time being to statically specifying it e.g.

    switchevents.defaultExpanded(1)

    Any assistance much appreciated!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    You should never have to explicitly get a content to expand (ie: by adding style="display:block"). Remove that first.

    The defaultExpand() function does work on your page- I just tested it locally. However, since you also have the persistence feature enabled:

    Code:
    switchnews.setPersist(true)
    The above will take over right after the first time the page is loaded (ie: reload the page) over any specified default expanded content:


    Code:
    switchevents.defaultExpanded(1)
    To truly test if the defaultExpanded feature is working, remove the setPersist() line first to see how the script behaves without persistence overriding things.

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

    Default

    thanks, you were right on the money with the persistence. Soon as I commented it out then the default worked.

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
  •