PDA

View Full Version : Support: Horizontal animated div collapse..



Shark_In
11-20-2008, 08:38 AM
1) Script Title: animatedcollapse.js, jquery-1.2.2.pack

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

3) Describe problem: Hi, the script above provides an excellent support for collapsible div and I seek the similar effect in horizontal direction from left-to-right or right-to-left. Can somebody kindly help in this regards :)

Kind Regards,
S.

ddadmin
11-21-2008, 03:56 AM
There's no easy way to change the orientation of this script unfortunately. I know what you mean though, and it's a script I'll probably put up down the road.

maximina
07-08-2009, 03:45 PM
Hi there, been using DD since 98, and surprisingly this is my first post!

Anyway, I've been using animatedcollapse a great deal. It's so flexible that I've found about a dozen different little uses for it, I especially like to nest divs within divs to create navs and subnavs with this script (now even better with the persistence option!).

I too would like to be able to use it for horizontal collapsing.

I changed the line:

var animateSetting={height: action}
to

var animateSetting={width: action}

Which works, for the most part, with one small glitch. Right after the div/s collapse there is a brief flash showing where the div once was, and I'm not sure how to fix this.

Any advice?

maximina
07-08-2009, 07:55 PM
Actually, I think I figured out what was causing the blinking... can't nest it in a list. No biggie.


But, I've noticed that this squeezes the div (instead of hiding the off-run), and when there are multiple lines, it can look rather silly. To fix this you can put a div with a set width within the div that will be scaled.

i.e.


<div id="animatedcollapsediv">
<div style="width:100px;">multiple<br>lines<br>of<br>text....</div>
</div>

This keeps the text from jumping around as it is rescaled, but it would be nice if the script could natively do all this by default, without giving a specific width.