简体   繁体   English

AOS(滚动动画)元素在 static 站点上不可见

[英]AOS (animate-on-scroll) elements invisible on static site

I'm making a site for a client and trying to implement AOS library to make it look more dynamic.我正在为客户创建一个站点并尝试实现 AOS 库以使其看起来更加动态。 I've followed instructions from the GitHub :我已按照GitHub的说明进行操作:

Add to <head>添加到<head>

<link rel="stylesheet" href="https://unpkg.com/aos@next/dist/aos.css" />

Add before </body></body>之前添加

<script src="https://unpkg.com/aos@next/dist/aos.js"></script>
  <script>
    AOS.init();
  </script>

No luck.没运气。 I've applied data-aos="fade-in" to a div in the Services section of this site (it should be obvious with the missing box) and it doesn't display at all for me.我已将data-aos="fade-in"应用到本网站服务部分的 div 中(缺少框应该很明显),但对我来说根本不显示。

Can anyone help?任何人都可以帮忙吗?

Thank you,谢谢,

Jack杰克

I've looked at the site and I think it has something to do with this css:我查看了该站点,我认为它与这个 css 有关:

html, body {
    overflow: hidden;
    overflow-y: scroll;
}

This also caused a double scrollbar for me, you should remove those two lines.这也给我造成了双滚动条,你应该删除这两行。

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

相关问题 选择要使用 jQuery 设置动画的元素时,AOS(滚动动画)库不起作用 - AOS (animate on scroll) library not working when selecting elements to animate with jQuery 在具有溢出的div中使用AOS(滚动动画) - Using AOS (animate on scroll) inside a div with overflow Initialise AOS - Angular Universal Server Side Rendering 中滚动库上的动画 - Initialise AOS - Animate on scroll library in Angular Universal Server Side Rendering 当你在那里滚动时 Aos.js 不显示元素 - Aos.js not showing elements when you scroll there 当 HTML5 视频元素在页面上时,滚动动画 (AOS) 动画不起作用 - Animate on Scroll (AOS) animations do not work when HTML5 video element is on page 在特定页面上禁用 AOS(动画) - Disable AOS (animate) on specific pages 是否可以在滚动上为flexbox元素设置动画? - Is it possible to animate flexbox elements on scroll? jQuery .scroll .animate用于多个元素 - jQuery .scroll .animate for multiple elements 在浏览器执行之前滚动不可见的元素 - Scroll invisible elements before browser does 使用“aos”在第一个元素上触发 animation,但随后其他元素应触发而无需进一步滚动 - Use 'aos' to trigger animation on first element, but then the other elements should trigger without further scroll
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM