PDA

View Full Version : Animated DIV Tag Problem



loganfisher`
01-29-2010, 04:31 PM
1) Script Title: Animated Div Tag

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

3) Describe problem: Ok if you go to www.mqndesign.com/onpoint and click the toggle buttons under the puzzle you will see that they stack on top of each other. I would like them to collapse once another toggle button is pressed. Is this possible? Please help I would greatly appreciate it.

Nile
01-29-2010, 09:56 PM
Change:


animatedcollapse.addDiv('info_box', 'fade=1,height=200px')
animatedcollapse.addDiv('info_box_2', 'fade=1,height=200px')
animatedcollapse.addDiv('info_box_3', 'fade=1,height=200px')
animatedcollapse.addDiv('info_box_4', 'fade=1,height=200px')
animatedcollapse.addDiv('info_box_5', 'fade=1,height=200px')
animatedcollapse.addDiv('info_box_6', 'fade=1,height=200px')
animatedcollapse.addDiv('info_box_7', 'fade=1,height=200px')
animatedcollapse.addDiv('info_box_8', 'fade=1,height=200px')


To:


animatedcollapse.addDiv('info_box', 'fade=1,height=200px')
animatedcollapse.addDiv('info_box_2', 'fade=1,height=200px,hide=1')
animatedcollapse.addDiv('info_box_3', 'fade=1,height=200px,hide=1')
animatedcollapse.addDiv('info_box_4', 'fade=1,height=200px,hide=1')
animatedcollapse.addDiv('info_box_5', 'fade=1,height=200px,hide=1')
animatedcollapse.addDiv('info_box_6', 'fade=1,height=200px,hide=1')
animatedcollapse.addDiv('info_box_7', 'fade=1,height=200px,hide=1')
animatedcollapse.addDiv('info_box_8', 'fade=1,height=200px,hide=1')

ddadmin
01-29-2010, 10:00 PM
You can group the DIVs together when you initialize them, which causes one to collapse when another is expanded. For example:


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

Please see demo #2 on the script page for more info.

BTW, please note that your page is currently in violation of our usage terms, since the credit notice doesn't appear inline on the page. Please reinstate the credit notice: http://www.dynamicdrive.com/notice.htm

Nile
01-29-2010, 10:09 PM
Oh. :) Listen to him, not me. ;)

loganfisher`
01-29-2010, 10:17 PM
Ok I am sorry I didnt realize that I had deleted it. It is back in there now.

I got them to group and switch out but I would like the divs to come down from the top and not from the bottom like it is currently doing. I want the div to expand and contract on every button push. Now is this possible?

Nile
01-29-2010, 10:57 PM
Hmm... That's going to be tough considering the 'toggle' height is from jQuery, and not from DD's code... Maybe ddadmin knows how to answer that...