On my page, there are several divs with default display styles set in an external .css file. When a certain condition is met, I use jQuery to turn one on and the others off using the fadeIn() and fadeOut() methods.
However, I've noticed that in Firefox 18, there are random instances where the fadeIn() doesn't work as expected. To troubleshoot, I added an alert to check the CSS display property:
alert($("#someDiv").css("display"));
In these cases where the fadeIn() fails, the alert outputs "undefined." I was expecting an empty string instead. What could be causing this issue?
Adding more context to Joseph's comment, when I rewrite the fadeIn() method like this:
$("#someDiv").fadeIn(400, function(){ $("#someDiv").css("display", "block") });
The problem resolves itself and the fadeIn() works correctly every time.