简体   繁体   中英

jQuery animate on scroll

I am using the jQuery animation scroll plugin ( https://github.com/mpalpha/animate-scroll ) to animate elements when they are focused.

This is how I am using the animate function inline in my HTML.

<article class="article1" data-animate-scroll='{"x": "0","y": "100", "alpha": "0", "duration": "0.7"}'></article>

This is how I'm calling the script :

$(document).animateScroll();    

The animation seems to be working. But there are some issues with animation.

For example when the treatment for younger kids box is scrolled it is empty. then after adolescent treatment on scroll it is also empty. Also it should only animate only once on first scroll.

How can I fix this.

This library: https://cdnjs.cloudflare.com/ajax/libs/gsap/1.16.1/TweenMax.min.js

Set effect with opacity: 0 over element when scroll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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