Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
adrianrotama

(ask) 100% screenHeight scroll when user scroll until the trigger

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Sorry Im a new user of greensock .

I want to achieve a 100% screenHeight scroll whenever user scroll until the trigger :

 

================================================================================

var tween7b = TweenMax.fromTo('#red2', 1, {y: "100%"}, {y: "0%", backgroundColor:'#C74A00', ease: Linear.easeNone});

var tween7c = TweenMax.to('#red2', 1, {y: "-100%", backgroundColor:'#C74A00', ease: Linear.easeNone}); 

 
new ScrollMagic.Scene({triggerElement: "#trigger6e", 
triggerHook: 0.85})
.setTween(tween7b)
.addTo(controller);
 
new ScrollMagic.Scene({triggerElement: "#trigger6e", 
triggerHook: 0.45})
.setTween(tween7c)
.addTo(controller)
.addIndicators();
==================================================================================
 
Sometimes its work, but sometimes it failed. I guess its getting confused because of two TweenMax.fromTo affected the same ID ? how could I achieve what I want then? thankyou before :)
 
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 


  • Recently Browsing   0 members

    No registered users viewing this page.

×