PDA

View Full Version : Animated Collapsible DIV internet explorer problem



redminator
08-17-2007, 07:53 AM
I used your Animated Collapsible DIV to make a web page and it works fine with mozilla but it doesn' work in internet explorer.

When the page loads in ie, the div loads open, and when i click it to collapse, it collapsesbut then it comes back to the expanded mode. Any ideeas?

The original script i took from your page works fine with internet explorer, but my page doesnt.

I attached an archive containing my page. The page wont work because it uses struts/jsp/jstl and a connection to a DataBase, but at the end I put the code again ("Payment X") which should work.

I am figuring that if I have big mistakes, you cand find them just by viewing the code.



Please help me:). Very desperate. And thanks a lot!


Forgot to say im a noob, so take it easy on me:).

jscheuer1
08-17-2007, 12:30 PM
You need to put IE into standards mode with an appropriate DOCTYPE, and your code must otherwise be valid or at least not have too many violations of the standards.

I looked at your code and the DOCTYPE used appears to be OK for the purpose mentioned above. However, as it is a .jsp page, there is no way to be certain of its generated source's validity or even of its served DOCTYPE, if any.

I'd really need a link to the live page for that.

Please post a link to the page on your site that contains the problematic script so we can check it out.

redminator
08-17-2007, 01:45 PM
Unfortunately, i can't give u a link because the page is still only on my computer/network.

Im using tomcat as a server. The only thing I could send you is the page source.
(right click on the page and view page source... save it and send it to you).

Would that help at all?


Thanks a lot.

jscheuer1
08-17-2007, 02:10 PM
That actually is what I would look at if I had a live link, so yes, it would help, but not as much as also having the live page to use as a resource. One thing I would mention though is that some of these local server 'proxies' or whatever the correct term for them is, can cause problems with all sorts of things that will not exist on a real server. This may or may not be the case here.

Oh, very important, if you send the 'view source' generated code of the browser, make sure it is from the browser giving you the problem. And make sure the problem is evident before you hit 'view source'.

redminator
08-20-2007, 06:43 AM
Sorry for my late post, here is the source of the page that has the problem.

Thank you very much.

jscheuer1
08-20-2007, 07:02 AM
There is no DOCTYPE at the very start of the page (there is one later on, but this is of no help in IE). That would be a problem in IE with this script. Also, and I realize this is just a local/private/test page, when you go live, you need to include the script credit on the page ala:

Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

As it is though, I couldn't easily find the script on the page. I did find the tag, it should look like so:


<script type="text/javascript" src="javascript/animated_collapse_menu/animatedcollapse.js">
/***********************************************
* Animated Collapsible DIV- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>

I noticed two <head> tags as well, that's invalid, but might not be a problem in this particular regard. Having no DOCTYPE that puts IE into standards compliant mode at the very start of the code is definitely a problem. There could also be other problems.

I also want to mention again that once the page is live, on a real server, this might not be the generated code. As a result, the problem might no longer exist at that point.

redminator
08-20-2007, 07:21 AM
1. I do specify the doctype in the code. Why doesn't it appear on the page source?

2. The same with the <head> section.... I have only one in the code of the page.

3. I am using a local server : tomcat 5 ( version 5.0.28 ). The application that I am working on is meant to work locally ( at least for the moment ).

4. Sorry about the violation with the code, I'll take a look at what I need to write on my page for all to be good.

5. Still any ideea what causes this problem, and most important what can I do to fix it?

Thanks again.


(Later Edit) Problem with violation taken care of. I included everything on the page.

jscheuer1
08-20-2007, 07:28 AM
It could very well be a tomcat 5 issue. As I've been trying to point out, these sort of local servers can oftentimes create problems that wouldn't exist on a real server. It just isn't right that tomcat 5 should be mangling your code so much (if that's what is really happening). If it is, a tomcat 5 help forum may be able to help you correct it if that can be done (it should be possible, but I cannot make any guarantee).

redminator
08-20-2007, 07:30 AM
Here is the page source again.

Sorry about this post, I didnt see you answered before. I'll try to find some tomcat forum. Thanks for everything.

jscheuer1
08-20-2007, 07:38 AM
Thanks for fixing the credit. That's just a legal matter that I feel obligated to mention as a moderator here, and has nothing to do with your problem. All of the other issues I pointed out before still exist. My best guess (since you say your code is valid before being served) is that it is a configuration problem with tomcat 5, as mentioned in my last post.

redminator
08-22-2007, 12:36 PM
Well... I fixed my problem.
"Fixed" sort of saying. I "tuned" it.
In the animatedcollapse.js ( the javascript file) in all the places that height was set to "0", I changed it to "1". With that little change.... all works fine. Thanks for the help anyway.

One more thing... all ok if I changed that? I still left the credit :P.

jscheuer1
08-22-2007, 02:35 PM
You may edit DD scripts as you see fit to make them work in your particular situation, and unless you have completely rewritten it (which you obviously have not) the credit should remain. As a courtesy to those who may view your source code, it would be nice, but is not required, to add a comment indicating that the script is modified.

marsel
08-27-2007, 03:03 PM
I haved a problem about animation gif in Internet Explorer, when i open/close a DIV, animation not work (turn off).
How about this?, can someone help me plz.

jscheuer1
08-27-2007, 04:23 PM
I haved a problem about animation gif in Internet Explorer, when i open/close a DIV, animation not work (turn off).
How about this?, can someone help me plz.

That is a known issue in IE with animated .gif when any link uses:


href="javascript: . . ."

What I would suggest is changing all links like this (example):


<a href="javascript:collapse1.slidedown()">Slide Down</a>

to (example):


<a href="#" onclick="collapse1.slidedown();return false;">Slide Down</a>

Another solution, and an even better idea is (example):


<span onclick="collapse1.slidedown();">Slide Down</span>

marsel
08-28-2007, 11:10 AM
That is a known issue in IE with animated .gif when any link uses:


href="javascript: . . ."

What I would suggest is changing all links like this (example):


<a href="javascript:collapse1.slidedown()">Slide Down</a>

to (example):


<a href="#" onclick="collapse1.slidedown();return false;">Slide Down</a>

Another solution, and an even better idea is (example):


<span onclick="collapse1.slidedown();">Slide Down</span>

That's work!!.., thank a lot.
Thank's for fasted respon. :)

MagneticPortal
02-23-2008, 11:04 PM
Well... I fixed my problem.
"Fixed" sort of saying. I "tuned" it.
In the animatedcollapse.js ( the javascript file) in all the places that height was set to "0", I changed it to "1". With that little change.... all works fine. Thanks for the help anyway.

One more thing... all ok if I changed that? I still left the credit :P.

Sounds like your quick code repair job won't help the rest of us....

I'd love to see what changes you made. I've tried changing every 0 to a 1 in the script, and only succeed in crippling the script further.

If you've found a "fix" that overcomes this IE glitch, I might be able to use the script on my site.

The original sample script posted at

http://magneticportal.com/animate.php

has the same IE display problem you've mentioned.
The sample at dynamicdrive

http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

works fine in IE when trying the onsite demo, but my installed version glitches in IE.

I'm guessing that a server setting is causing the always expanded state, as dynamicdrive didn't have to edit animatecollapse.js

http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.js

to get their demo to work properly in IE.

The only difference between the dynamicdrive demo and the one posted at my site would be the server handling it. Must be the settings. Any clues how to fix?

jscheuer1
02-24-2008, 05:04 PM
I've tried changing every 0 to a 1 in the script, and only succeed in crippling the script further.

As this is a rather old thread covering a variety of issues, please start a new thread for this issue.