How to hide animated elements on load?

后端 未结 3 1954
别跟我提以往
别跟我提以往 2021-02-13 20:29

I\'m using animate.css with waypoints.js in my landing page. I want to animate elements when user scrolls the page. But, the problem is that I need to hide elements before the a

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-13 20:51

    You can do it with only CSS.

    Let's say you are trying to animate a title. Give your element's class this css:

    .title { visibility: hidden; }
    

    and give the animated class (which comes from the animate.css) this css:

    .animated { visibility: visible !important; }
    

    When it hits the waypoints view it will add .animated per animate.css's code and then it will be visible for the animation.

提交回复
热议问题