View Full Version : Collapable Div springing back to full height in IE

11-27-2007, 04:57 AM
1) Script Title: Animated Collapsable Div

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

3) Describe problem:

I'm having problems getting the collapse to work in IE 6 or 7.
I have the script working in Firefox and Safari.

In IE 6 or 7, the script will look like collpase to 0 height, then spring back to the full height.

I suspect the problem is that I am using the divs within a table structure - and IE is resizing to the height of the table, not the height of the div. (Even though I can see the script attempting to resize the div to 0 when collapsing)

It is not an option to restructure the site within divs.

http://www.rurallaw.org.au/handbook/test.php (Hover over left hand menus)

Any suggestions?

11-27-2007, 05:59 AM
Actually, from what I can tell, the problem is simply due to your page missing a valid doctype declaration (http://www.javascriptkit.com/howto/doctype.shtml) at the very top. In IE, this is required in order for the script to work correctly. For example, if you add this to the top of your page, all seems fine again:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

11-27-2007, 08:43 AM
Oops - I didn't even check that.

I read the bit about valid doctypes on your site - but wrongly assumed that this site had been fixed a few months ago (We went on a doctype fixing rampage).

Will try that first thing tommorow.