michalsnik / aos

Animate on scroll library
MIT License
26.83k stars 2.6k forks source link

When using Animate.css and zoomInUp, or any Animate.css zoom animation, the element ends up with opacity: 0 #457

Open 09Ria09 opened 5 years ago

09Ria09 commented 5 years ago

This is:

Specifications

Expected Behavior

the element should stay visible after the animation ends

Actual Behavior

the element's opacity is set to 0 by this:

html:not(.no-js) [data-aos^="zoom"][data-aos^="zoom"] {
    opacity: 0;
    transition-property: opacity,-webkit-transform;
    transition-property: opacity,transform;
    transition-property: opacity,transform,-webkit-transform;
}

Steps to Reproduce the Problem

  1. Include animate.css: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.7.0/animate.min.css">
  2. Set:
    AOS.init({
        useClassNames: true,
        initClassName: false,
        animatedClassName: 'animated'
    });
  3. Set element's: data-aos="zoomInUp
  4. Scroll to the element

Possible Solution

Check if animatedClassName is set to default before applying

html:not(.no-js) [data-aos^="zoom"][data-aos^="zoom"] {
    opacity: 0;
    transition-property: opacity,-webkit-transform;
    transition-property: opacity,transform;
    transition-property: opacity,transform,-webkit-transform;
}
destiny0114 commented 5 years ago

how to fix?

destiny0114 commented 5 years ago

i fix it by using developer tool to modify aos.css properties and save to local and load it