开发者

Jquery problem slidedown

Hallo i have this script:

<script type="text/javascript">

function animateIt() {
  $(".logo img").slideUp("slow")
}
animateIt();
</script>

When i use slideup. The image going away to the top. But i 开发者_开发百科wil use the slidedown. But when i change slide up to slideDown("slow"). My .logo img is not working? What do i wrong?


You have to wait for the dom to be ready:

<script type="text/javascript">

function animateIt() {
  $(".logo img").slideUp("slow")
}

//wait for the onload event:
$(animateIt);

</script>


why are you running this script before the document is ready? have you tried replacing animateIt(); with

 $(animateIt);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜