简体   繁体   English

Wow.js在服务器中不起作用

[英]Wow.js not working in server

In am using wow.js to animate element on scroll. 在使用wow.js为滚动上的元素设置动画。 It works great in local but when I uploaded to server, the animated class is called before scrolling (with page loads). 它在本地效果很好,但是当我上传到服务器时,动画类在滚动之前被调用(带有页面加载)。 Click here 点击这里

to see it live. 现场观看。 在此处输入图片说明

I think it worked locally because the page assets above the gif loaded faster than in the web. 我认为它在本地有效,因为gif上方的页面资产加载速度比网络加载速度快。 When I open the page, the wow used div is loading with "animated" class before I scroll for it (It happened because the wow div was visible while the header page assets was loading). 当我打开页面时,在滚动之前,“ wow div使用的是“ animated”类(发生这种情况是因为在加载标题页资产时可以看到wow div )。

The wow.js is used to animate some HTML element on scroll and not to control the gif animation state but it works as you want because the wow apply visibility: visible in element after its div is visible. wow.js用于在滚动上设置一些HTML元素的动画,而不是用来控制gif动画状态,但是它可以按您希望的方式工作,因为wow应用了visibility: visible div可见后在元素中可见。

You can start the animation of the gif when its visible at the page if you show the image only when you scroll, controlling its visibility state (loading with image visibility hidden and then changing it to visible). 如果仅在滚动时显示图像,并控制其可见性状态(在隐藏图像可见性的情况下加载,然后将其更改为可见),则可以在页面上显示gif时启动gif动画。

You can also start the gif animation when scrolling if you use something like this plugin to "lazy load" the image. 如果使用类似此插件的东西来“延迟加载”图像,则还可以在滚动时启动gif动画。 "Lazy load" plugin will load the image when it is going to be visible in the window. 当“延迟加载”插件在窗口中可见时,它将加载该图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM