Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ctrl = new ScrollMagic.Controller({
- globalSceneOptions: {
- triggerHook: 'onLeave'
- }
- });
- var animationEvents = new TimelineMax()
- .fromTo($('#show .elem1'), 0.5, {opacity: '1'}, {opacity: '0', ease:Power1.easeInOut}, 0)
- .fromTo($('#show .elem2'), 1, {x: '0%'}, {x: '-100%', ease:Power1.easeInOut}, 2)
- .fromTo($('#show .elem3'), 0.5, {opacity: '0'}, {opacity: '1', ease: Back.easeOut}, 2.4)
- .fromTo($('#show .elem4'), 1, {opacity: '0'}, {opacity: '1', ease:Power1.easeInOut}, 3);
- new ScrollMagic.Scene({
- triggerElement: '#wrapper',
- duration: '400%',
- })
- .setPin('#wrapper')
- .setTween(animationEvents)
- .addTo(ctrl);
- .fromTo($('#show .elem2'), 1, {x: '0%'}, {x: '-100%', ease:Power1.easeInOut}, 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement