Jump to content
Search Community

How NOT to use GSAP

ZachSaucier test
Moderator Tag

Recommended Posts

Anything that uses jQuery for selectors and creating animations setTimeout/setInterval would get my vote. setTimeout/setInterval has this wonderul effect when you switch tabs and come back 10 minutes later... 100,000 animations all starting at the same time.

 

 

  • Like 1
Link to comment
Share on other sites

I think I have a pretty neat solution here for getting a div to move back and forth. Think something like a yoyo, but horizontally. I'm still working on the reason the opacity doesn't go back to 100% on the second pass, but other than that, I'm pretty happy with it. Maybe I'll add a rotation this weekend if I have time.

 

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

 

Edit: I'm kinda wondering if I can make it a little smoother too. I'll work on it.

  • Like 2
  • Haha 2
Link to comment
Share on other sites

Love the naming!

$(".l2-ht-gr-001-bnew-iewq-4g7-kl3478-vqw-kl09-alewq-63rt-copy")

 

That reminds of more bad jQuery stuff. Always using class names to keep track of state.

if ($(".l2-ht-gr-001-bnew-iewq-4g7-kl3478-vqw-kl09-alewq-63rt-copy").hasClass("active")) {
  ... 
} else {
  $(".l2-ht-gr-001-bnew-iewq-4g7-kl3478-vqw-kl09-alewq-63rt-copy").addClass("active");
}

 

  • Like 1
  • Haha 2
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...