Results 1 to 3 of 3

Thread: Switch Content Script defaultexpanded not working with preservance

  1. #1
    Join Date
    Mar 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Switch Content Script defaultexpanded not working with preservance

    1) Script Title: Switch Content Script

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

    3) Describe problem:

    I need one of my content to be expanded by default but allow preservance. I noticed this update on the DD page,
    Jan 25th, 07: to fix a bug with the defaultExpanded() feature not being honoured when persistence is enabled. Only applicable the first time the page is loaded within a browser session. Only .js file changed!
    To me the bug is not fixed because I have the following set and it is not working:

    Code:
    <script type="text/javascript">
    var instance=new switchcontent("switch-instance", "div")
    instance.setStatus('<img src="/img/open.png" /> ', '<img src="/img/closed.png" /> ')
    instance.setPersist(true, 7)
    instance.collapsePrevious(false) 
    instance.defaultExpanded(0)
    instance.init()
    </script>
    I cleared all cookies and cache and reload the page and the instance is not expanded. Can someone help?

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

    Default

    A quick test and it seems to work for me. Are you sure you're using the updated .js file? Please post a link to the page on your site that contains the problematic script so we can check it out.
    DD Admin

  3. #3
    Join Date
    Mar 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hey man thanks for the quick response. I think I got it to work, but one thing I need help with is that I need a separate link inside the expanded div to close it with. (a button that says hide). How do I do that?

    I tried using <a href="javascript:instance.sweepToggle('contract')">Hide</a>

    this works, however it will close ALL the boxes in the instance and I only need one closed. Appreciated greatly.

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
  •