Jump to content
Search Community

Multiple attr class selectors

kodralex test
Moderator Tag

Recommended Posts

I've trying to display lots of falling icons. What I have so far is working fine, but it's only display one icon. I need to be able to display multiple css class selectors. 

 

gsap.set(Div,{attr:{class:'icon1'}

I made have about 10 css classes in total e.g. .icon1 / .icon2 / .icon3 etc. In the example I've just added 2. I've tried many ways to add multiple classes but can't seem to get it working. Any ideas?

See the Pen NWXmyGP by alexkodr (@alexkodr) on CodePen

Link to comment
Share on other sites

Hi @kodralex :)

 

Looks like that's an old one from our own Diaco. I made an updated version of his idea a few months ago that takes advantage of GSAP 3 syntax and the new random utility method. I used a sprite sheet for mine which should work well for you too. Hopefully it helps. Happy tweening. :) 

 

See the Pen BadPdXx by PointC (@PointC) on CodePen

  • Like 5
Link to comment
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.
×
×
  • Create New...