Results 1 to 3 of 3

Thread: Animated Collapsible DIV v2.4 help closing DIVs

  1. #1
    Join Date
    Jun 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Animated Collapsible DIV v2.4 help closing DIVs

    1) Animated Collapsible DIV v2.4

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

    3) Describe problem:

    Script all working fine but….
    I have six Divs on a page. It is all configured with image swapping on toggle but I cannot find a way to close any open Divs when a new Div is toggled to expand i.e. only one DIV open at any one time. Can close open Divs using a separate text command like

    <a href="#" rel="collapse[jason, kelly]">Collapse Jason and Kelly DIVs</a>

    but would like this to happen when toggling a new DIV to open.

    It seems that it is not possible to “stack” commands in REL= so is there another solution, please?

    Thanks
    David

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

    Default

    You can "group" multiple collapsible DIVs so when one within the group is expanded, the rest is closed. See Example 4, 5, and 6 on the script page for a illustration of this.

    To do this, inside the initialization code, just give each collapsible DIV the same "group" name, for example:

    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')
    DD Admin

  3. #3
    Join Date
    Jun 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for that, easy when you know how!

    Missed the significance of groups, behavior absolutely what I wanted.

    Great stuff,

    David

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
  •