Jump to content
Search Community

How to change placeholder color using gsap?

AsKadir test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

  • Solution

Several problems: 

  1. Your jQuery object is totally empty - you can see that with console.log(input[0]), for example. So it's not selecting what you think it's selecting.
  2. JavaScript doesn't have any access to pseudo elements. That has nothing to do with GSAP. 

You can, however, use JavaScript to animate the actual CSS rule itself. Here's a fork that shows how to use CSSRulePlugin for that: 

See the Pen 7e04b6f35e1944046c17dc803151e46a?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Does that clear things up? 

  • Like 3
  • Thanks 1
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...