Open saltnpixels opened 8 years ago
+1
If you are using GSAP you can use the .set()
method and add multiple classes that way.
+1 The comments in Scrollmagic.js are wrong.
This doesn't work.
Have you tried the .set
method using GSAP? You only need the TweenLite to use the .set
method.
Same here.
So this bug is a dealbreaker for me. Does anyone recommend an alternative library?
This behavior surprised me.
While it's not a deal breaker.
I would expect multiple uses of setClassToggle()
to append behaviors to a controller.
@estevancarlos FYI, if you're using jQuery with ScrollMagic, you have a bit more flexibility since you can do multiple selectors:
https://api.jquery.com/multiple-selector/
In order words:
new $.ScrollMagic.Scene(options)
.duration(100)
.setClassToggle(
"a[href='moo'] ~ ul,a[href='moo']",
"is-active"
);
Example of how to trigger multiple id's at the same time
new ScrollMagic.Scene({ triggerElement: '#intro', triggerHook: 'onLeave' }) .on('enter leave', function () { $('#nav-bar').toggleClass('background-black'); $('#threeAnim').toggleClass('display-none'); }) .addTo(controller);
I tried adding multiple classes and it doesnt work this an error.
The token provided ('flipInX flipOutX') contains HTML space characters, which are not valid in tokens. on: .setClassToggle('.phone', 'flipInX flipOutX')