1 ScrollTrigger.create({ 2 trigger: '.box', 3 start: 'top top', 4 end: '+=2000', 5 markers: true, 6 scrub: true, 7 pin: true, 8 animation: 9 gsap.timeline().to('.box1', { 10 scale: 1.5, borderRadius: '50%',background:'blue' 11 , onStart() { 12 console.log('start'); 13 }, 14 onComplete() { 15 console.log('ended'); 16 }, 17 onReverseComplete() { 18 console.log('reverse ended'); 19 } 20 }), 21 onUpdate(e) { 22 console.log(e.progress) // 0.5; 23 }, 24 onEnter: () => { 25 console.log('滚动到start位置触发') 26 }, 27 onEnterBack: () => { 28 console.log('滚动超过end位置,再进入滚动区域触发') 29 }, 30 onLeave: () => { 31 console.log('滚出end位置时触发') 32 }, 33 onLeaveBack: () => { 34 console.log('滚出end位置,再滚回来超过start位置触发') 35 }, 36 })
标签:end,log,gsap,start,事件,console,true From: https://www.cnblogs.com/jssoft/p/18018740