Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你好,我有这个脚本:
<script type="text/javascript"> function animateIt() { $(".logo img").slideUp("slow") } animateIt(); </script>
当我使用上滑。图像移到顶部。但我会使用下滑。但是当我将幻灯片更改为 slideDown("slow"). 我的 .logo img 不工作?我错了什么?
您必须等待 dom 准备好:
<script type="text/javascript"> function animateIt() { $(".logo img").slideUp("slow") } //wait for the onload event: $(animateIt); </script>
为什么在文档准备好之前运行这个脚本?你试过替换 animateIt(); 和
$(animateIt);