Jquery问题幻灯片

发布于 2024-09-08 15:57:38 字数 255 浏览 1 评论 0原文

你好,我有这个脚本:

<script type="text/javascript">

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

当我使用幻灯片时。图像移至顶部。但我会使用幻灯片。但是当我将幻灯片向上更改为幻灯片向下(“慢”)时。我的 .logo img 无法正常工作?我做错了什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

-黛色若梦 2024-09-15 15:57:38

你必须等待 dom 准备好:

<script type="text/javascript">

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

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

</script>

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>
烧了回忆取暖 2024-09-15 15:57:38

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

 $(animateIt);

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

 $(animateIt);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文