简体   繁体   English

jQuery滚动动画

[英]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. 我正在使用jQuery动画滚动插件( https://github.com/mpalpha/animate-scroll )对元素进行聚焦时进行动画处理。

This is how I am using the animate function inline in my HTML. 这就是我在HTML中内联使用animate函数的方式。

<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 该库: https : //cdnjs.cloudflare.com/ajax/libs/gsap/1.16.1/TweenMax.min.js

Set effect with opacity: 0 over element when scroll. 设置不透明度效果:滚动时在元素上方设置0。

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

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