From the course: CSS: Scrolling and Parallax

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Adding a GSAP tween

Adding a GSAP tween

- [Instructor] To get started using GSAP Tweens, you create a new TweenMax object, and you add some additional methods to this object that controls your animation. The most popular ones are the from method, which allows you to select a target and then pass along some variables. So the target here will be the element that you want to animate, and you would specify the beginning. So that's what 'from' means here. The beginning state of that element by passing along some variables. So for example, if you wanted to animate an element from opacity of zero to one, you would pass along an opacity variable here of zero. Then if the element in the CSS already has an opacity of one, it would just animate from your defined opacity of zero to that opacity of one. Conversely, you can also use the to method and that does the reverse. Once again, you specify the DOM element using target, and then you pass along the variables…

Contents