PDA

View Full Version : Animated Collapsible DIV - Problem in IE (Validated)



andrewmta
08-19-2007, 10:41 PM
Hey,

Thanks up front for taking the time to look into this problem. I appreciate your time.

I'm having problems with the DynamicDrive script: Animated Collapsible DIV (http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm)

It works fine in Mozilla based browsers like Fire Fox but is having problems in IE 6.0. Specifically, the animation is working but the div is failing to hide. I'm afraid my JS knowledge is limited to cut and paste largely so I can't investigate the problem myself.

You can see the problem in action here: REMOVED

I searched the forums here for others experiencing the same problem. One individual mentioned the exact problem and the advice given to him was to check his doctype.

I've switched my site to the recommended strict doctype, and had it validate successfully with no errors using the W3C Validator (http://validator.w3.org/check?uri=www.wordsonashirt.ca&charset=%28detect+automatically%29&doctype=Inline&group=0).

The script is unaltered except that I moved the scripts copyright credit inside of the JS file so that it would validate properly on the strict doctype.

Any help would be appreciated. Thanks.

jscheuer1
08-20-2007, 03:24 AM
Get rid of this:


<!-- Header Start -->

Any comment before the actual page start in IE throws it into quirks mode. However, this script requires standards compliant mode which your DOCTYPE will trigger in IE if you remove the comment.

andrewmta
08-20-2007, 09:47 PM
Thank you. I appreciate your help. I'm surprised it validated.

jscheuer1
08-21-2007, 12:32 AM
There was nothing invalid about the placement of the comment. It is a peculiarity of IE that makes it react that way to any comment placed in that position.

acer88
10-09-2007, 07:28 PM
I have a similar problem at hand, except I am using this in a php file where at the very top I have an include that uses sessions, etc. the page works just fine in firefox but most of my users are IE and the divs are always expanded. any ideas as to how to fix this?

thanks

jscheuer1
10-09-2007, 09:39 PM
I have a similar problem at hand, except I am using this in a php file where at the very top I have an include that uses sessions, etc. the page works just fine in firefox but most of my users are IE and the divs are always expanded. any ideas as to how to fix this?

thanks

There should be a way to move the include lower, all it needs to be is below the DOCTYPE declaration in the generated source. This assumes that you have a valid with URL DOCTYPE of HTML 4.01 transitional or greater.

A link to your page would help, but since it is PHP, I may also need to see the PHP code used to generate the HTML.

Something like this should work though:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<-- the include code can go here -->
<html>

acer88
10-10-2007, 09:13 PM
here is the code in my page, Found in that config file is the first line of code that starts the sessions, which can be seen below as well. If I move the include below the doctype, then I get an error associated with sessions. Thanks for any suggestions on this.

Index.php

<? include ("config.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<HEAD>

config.php


<?php
session_start();

jscheuer1
10-11-2007, 04:10 AM
That doesn't sound right to me, but if that is what is happening, who am I to say? I'm not much up on PHP. I'd suggest taking this question - how to use the session_start() directive after the DOCTYPE - to the PHP forum. Folks more knowledgeable about PHP hang out there.

One thing I would try is removing the DOCTYPE from the page and having config.php serve it. This could be done various ways I bet. One would probably be:


<?php
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
session_start();
?>

I did notice that in your config.php there is no closing ?>. But you may have just left that out because there are other things after session_start();.

Ikhisa
11-21-2007, 06:18 AM
Hello !
I will not create another thread on Animated Collapsible DIV's problems with IE to not make too much thread on the same subject :)

I have a quite different problem with AC. It works perfectly in Firefox, and the border i've assigned to the script appear. But on IE, it doesn't. Instead of the that, the cute border i've made is replaced by a blank. The image doesn't appear and i don't know what to do.

Sorry if it's not very clear, but i'm a beginner in coding and moreover i'm french so it's not very easy to explain it :)

Thanks for your answers :)

jscheuer1
11-21-2007, 05:55 PM
Hello !
I will not create another thread on Animated Collapsible DIV's problems with IE to not make too much thread on the same subject

We wish you would.