2011-05-05 29 views
0
<div id="updatePlayerList"> 
//some content 
</div> 

我的代码是这样的jQuery的隐藏未服用参数

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

问题是,它与进行等待1000millisecond(如淡入淡出效果)

解决的立即隐藏:

问题是与原型和jQuery的冲突 找到了解决办法在这里: Problem jQuery and Prototype

+0

你能给更多的上下文时间? – Ikke 2011-05-05 07:31:05

+0

不要听起来很愚蠢,但为什么你使用'{}'? – 2011-05-05 07:32:40

+0

我想要在这里淡出某种效果 – 2011-05-05 07:44:30

回答

2

你的代码似乎是错误的。它应该是(){}

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

文档:​​

.hide(duration, [ callback ])

如果你想等隐藏前一段时间,你应该使用delay()

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

延迟: http://api.jquery.com/delay/

+0

我不想延迟我只想淡入淡出效果 – 2011-05-05 07:40:51

+0

@achieverprince这样? :http://jsfiddle.net/jomanlk/esLU7/ – JohnP 2011-05-05 07:41:40

+0

你有些事情是这样的 – 2011-05-05 07:49:09

0

jQuery .hide()采用两个(可选)参数,一持续时间和一个回调函数。你传递的参数是没有时间jQuery将等待执行的效果,效果