How to stop Tweenmax animation during animation
3 answers
To do this, you will need to use the TimeLine from GSAP.
A simple example of how you can use this:
CDN for TimeLine plugin:
https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.5/TimelineLite.min.js
A small snippet for using it:
var toolTimeline = new TimelineMax();
toolTimeline.to("div",3, { top: '90px', });
$("#stop").click(function(){
toolTimeline.stop();
})
Pressing the "stop" button stops / pauses it.
+1
source to share