Results 1 to 6 of 6

Thread: Animated collapse Hide one div, show one div

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

    Default Animated collapse Hide one div, show one div

    1) Script Title:
    Animated collapse

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

    3) Describe problem:
    Hi!

    I'm trying to implent a functionality that will let me hide one div and at the same time another div becomes visible. I'm a javascript beginner so I don't really know how to solve it.

    I tried with:
    <div id="view"><a href="javascript:animatedcollapse.show(['hidden', 'hiddentext', 'hide']);animatedcollapse.hide('view')">View more</a></div>

    And some other similar ones, but no luck..

  2. #2
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    HI, I am also trying to do this, Im sure it has something to do with groups but can not figure it out,

    I have an image as a link I want one div to open and one to close when link is clicked,

    Please if anyone can help with this it would be much appreciatedl.

  3. #3
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Does anyone still check this forum section?

    could realy use some help on this one.

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

    Default

    On the DD demo page, examples 4-6 should demonstrate this already. Basically, if you initialize a collection of collapsible DIVs as a group, opening one within it closes any previously open DIVs within the DIV. The way to initialize them as a group then is just to add the code in red to the initialization code:
    Code:
    animatedcollapse.addDiv('cat', 'fade=0,speed=400,group=pets')
    animatedcollapse.addDiv('dog', 'fade=0,speed=400,group=pets,persist=1,hide=1')
    animatedcollapse.addDiv('rabbit', 'fade=0,speed=400,group=pets,hide=1')
    Where "pets" is an arbitrary but shared group name.
    DD Admin

  5. #5
    Join Date
    Mar 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ddadmin View Post
    On the DD demo page, examples 4-6 should demonstrate this already. Basically, if you initialize a collection of collapsible DIVs as a group, opening one within it closes any previously open DIVs within the DIV. The way to initialize them as a group then is just to add the code in red to the initialization code:
    Code:
    animatedcollapse.addDiv('cat', 'fade=0,speed=400,group=pets')
    animatedcollapse.addDiv('dog', 'fade=0,speed=400,group=pets,persist=1,hide=1')
    animatedcollapse.addDiv('rabbit', 'fade=0,speed=400,group=pets,hide=1')
    Where "pets" is an arbitrary but shared group name.
    Thank you so much, When put in the way you did in this post it made pefrect sence! Had it all working like a dream in minutes, Thanks again, very much appreciated.

  6. #6
    Join Date
    Aug 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the attempt to resolve the problem. I was able to clarify everything for myself. Partially though.

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
  •