Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Vool.Studio

Triggering SpliText on multiple classes with ScrollMagic

Recommended Posts

Hey everyone, 

I'm stuck with ScrollMagic and SplitText. 

I'm using SplitText for many classes. I need to replicate the same function all over again in the same page. 

All the other animations are fine, except for SplitText.

splitTextBody = new SplitText(".split-text-body", {type:"words"}),
wordsbody = splitTextBody.words;

  $('section').each(function(){

    var textBlock = new TimelineMax();
    textBlock.add(TweenMax.to($(this).find('.underline-body'), .75, {x:0, ease:Expo.easeOut}))
             .add(TweenMax.staggerFrom($(this).find(wordsbody), 0.8, {opacity:0, y:"100%", ease: Expo.easeOut}, 0.012))
             .add(TweenMax.staggerTo($(this).find('.underline-form'), .75, {x:0, ease:Expo.easeOut}, 0.12), '=-1');

    var scene = new ScrollMagic.Scene({
      triggerElement: this,
      duration: 0,
      offset: 0,
    })

    .setTween(textBlock)
    .addTo(controller)
    });

I'm able to call SpliText with no problem when it's just one for each page.
But not in this case. When I have classes like this I'm not able to figure it out. 

 

Thanks in advance for the help! 

Cheers.

 

Link to post
Share on other sites

Hi Lorenzo,

 

It would be very helpful to have more context here and a demo

 

It's really hard to try to offer any suggestion without having a clear picture of what's going on - How things are setup, their scope, etc...

 

  • Like 2
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×