tags:

views:

241

answers:

4

I am using the following to fade a div with slideffect.

$('div.clsBlue').eq(2).fadeOut(1000, function() {

                   });

This fades with animation in IE7 perfectly but not in mozilla 3. Any suggestions?

A: 

Why are you defining a callback function when it's not needed?

Also, what happens in FireFox 3? JavaScript error? Unintended fade effect?

Nicholas H
the callback is needed since i am looping over div's using each and i want the fade one after the other. In FireFox3, the div hides without a fade. It's like calling hide() directly. It does not fade out
KJai
A: 

Are you running in quirksmode? Sometimes if you don't have a specified doctype jQuery animations can do funny things.

Fermin
I have a doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
KJai
+1  A: 

Hi,

I got the same problem: IE 6 worked fine, but FFox 3 didn't.

I solved this problem setting the container DIV

height: auto

Regards.

ATorras
I tried using height:auto too...not effect :(
KJai
It also worked setting the height to a fixed value like 50px...
ATorras
I changed it to 50px. No effect still. I am jQuery 1.3.2
KJai
jQuery 1.3.1 and FFox 3.0.10.Maybe you need initialize width property like the sample:<div id="div1" style="clear: both; padding-left: 4em; margin-top: 1.5em; margin-bottom: 2em; width: 300px; height: 76px;"> <div style="width: 200px;"> <label>XYZ:</label> </div> <div style="margin-left: 2em; padding-top: 1em;"> <div style="clear: both;"> <div style="width: 150px; float: left;"> <label>XYZ</label> </div> <div style="float: left; margin-left: 30px; width: 20px;"> <input type="radio" value="v1" checked="checked" name="n1"/> </div> </div>...
ATorras
A: 

The solution is over here

http://stackoverflow.com/questions/748113/jquery-fade-effect-not-working-in-ff

KJai