jQuery: fadeIn problem

Hello there x)

I’m new in this forum & in jQuery’s world!
Before starting, I’d like to apoligize for my english, it’s not my native language.

My knowledges in html/css are good, but i’m a novice in Javascript (but I already played with lightboxes using jQuery, modifying values and trying to make it fits to my websites).

Well, I received today the book “Novice to Ninja - jQuery” and I arrived to the page 60. That’s… an amazing and passionnate book, I readed and practised 6 hours in a row, and I can’t even sleep until I find why the fadeIn function doesn’t work while the fadeOut is working o.O I tried it on buttons, to hide/show selections, it worked. But it doesn’t when I apply it to a div or a paragraph :confused:

Here is my source code:

$(document).ready(function(){
$(‘#test’).fadeIn(3000);
});

And in the HTML page:
<p id=“test”>Welcome to StarTrackr! the planet’s premier celebrity tracking and monitoring service. Need to know where in the world the best bands, musicians or producers are within 2.2 square meters? You’ve come to the right place. We have a very special special on B-grade celebs this week, so hurry in!</p>

If I replace fadeIn by fadeOut, it works: my paragraph goes from black to hided.
So… what’s the prob? :S

Thanks in advance!

The fadeIn method find that the element is already fully visible, so it has nothing that needs to be done.

Shouldn’t the element first be hidden, so that the fadeIn method has something that can be faded in?

Thank you! It solved my problem!

New code:

$(document).ready(function(){
$(‘#test’).hide();
$(‘#test’).fadeIn(3000);
});

:smiley: