1

你好,我有这个脚本:

<script type="text/javascript">

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

当我使用上滑。图像移到顶部。但我会使用下滑。但是当我将幻灯片更改为 slideDown("slow"). 我的 .logo img 不工作?我错了什么?

4

2 回答 2

1

您必须等待 dom 准备好:

<script type="text/javascript">

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

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

</script>
于 2010-07-07T13:45:31.233 回答
0

为什么在文档准备好之前运行这个脚本?你试过替换 animateIt(); 和

 $(animateIt);
于 2010-07-07T13:45:11.843 回答