views:

261

answers:

4

Hello, I have div, which has id 'content'. It's visible.

<div id="wrapper" style="display:block">
  <div id="content">
    Some text
  </div>
</div>

Now I want to fade it out:

$('#wrapper').fadeIn( 1500 );
$('#content').click(function(){
   $(this).fadeOut( 1500 );
});

And nothing happens. But when I wrote:

$('#content').fadeIn( 1500 );

It hides and then shows again.


Here is css

#content
{
    height: 100%;
    width: 100%;
}

Browser: Firefox 3.5.3 under Linux Gentoo

upd

When I type code:

$('#content').hide();

It hides correctly.


upd

I've solved problem... I can't understand, why did it was... Just replaced jquery.min with jquery

A: 

You have wrote $('#content') in the fadeOut and $('#conent') in the fadeIn. Other that this the effects are being called exactly the same way and offer no explanation as to why they wouldn't both be working as expected.

WDuffy
Sorry, it was my type-mistake.
Ockonal
Ockonal, I setup a test with the code you supplied (copy/paste) and it worked fine in Windows XP Firefox 3.5 and IE 8 if that helps any.
WDuffy
A: 

You are also leaving a # out in "#wrapper" (line 1 of jQuery).

David
Yeah, I can't post all code, cause it's too big. Thanks.
Ockonal
+1  A: 
Dominic Cooney
I've solved my problem. I can't copy all code, cause it's too big and has it's own dependings. But I'll make your post as answer on my question. Thanks.
Ockonal
+1  A: 

It works for me, firefox on OSX. Make sure that your id's are unique, if you have a duplicate it might not work right. Also, your style: block is redundant, divs are blocks by default.

DGM