0
<div id="updatePlayerList">
//some content
</div>

my code is like this

<script>
    $('#updatePlayerList').fadeOut(1000);
</script>

Problem is it hides immediately with out waiting for 1000millisecond( like a fade effect)

SOLVED:

Problem was with prototype and jquery conflict found a solution here: Problem jQuery and Prototype

2
  • Not to sound silly but why are you using { } ? Commented May 5, 2011 at 7:32
  • i want a fadeout kind of effect here Commented May 5, 2011 at 7:44

2 Answers 2

2

Your code seems to be wrong. It should be ( ) not { }

$('#updatePlayerList').hide(1000); //takes 1000 ms to hide

Docs : http://api.jquery.com/hide/

.hide( duration, [ callback ] )

If you want to wait a while before hiding, you should use delay()

$('#updatePlayerList').delay(1000).hide(400);//waits 1000ms to before hiding. Then takes 400ms to hide

Delay : http://api.jquery.com/delay/

Sign up to request clarification or add additional context in comments.

6 Comments

i don't want delay i just want a fade effect
What do you mean something like this? Is it or is it not, what you are looking for?
If it's working in the fiddle, the code is correct. So it's likely something wrong at your end
try setting up your page in jsfiddle.net and post it in your question.
i found the source of the problem
|
0

jQuery .hide() takes two (optional) parameters, a duration and a callback function. The parameter you're passing is not the time jQuery will wait to execute the effect, it is the duration of the effect

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.