Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
7
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

updated at

TweenMax,TimelineMaxで、クラスの付け替えをしたい

表題の通りなのですが、
Timelinemaxを利用する際に、jQueryでいうところのaddClassやremoveClassってどうやるんだろうと悩み、恥ずかしながら調べるのに時間がかかってしまったので、備忘録的に記事に残します。

結論から言うと、ドンピシャな記事が公式にちゃんとありました。

Timelinemax: add classes

TimelineMax

クラスをつけたいとき(addClass)

const tl = new TimelineMax();
tl.set('.target', {className:"+=active"});

クラスをとりたいとき(removeClass)

const tl = new TimelineMax();
tl.set('.target', {className:"-=active"});

TweenMax

クラスをつけたいとき(addClass)

TweenMax.set('.target', {className:"+=active"});

クラスをとりたいとき(removeClass)

TweenMax.set('.target', {className:"-=active"});
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
7
Help us understand the problem. What are the problem?