Jump to content
Search Community

Flip plugin onEnter is not working, why?

Leemoon test
Moderator Tag

Recommended Posts

You probably need to use the targets property. If you need more help, please provide a minimal demo.

 

Quote
targets String | Element | Array | NodeList - by default, Flip will use the same targets from the state object provided in the first parameter, but if you'd like it to only animate a subset of those, you can define them here as either selector text (".class, #id"), an Element, an Array of Elements, or a NodeList. If any of the targets provided are NOT found in the state object, they will be passed to the onEnter and not included in the flip animation because there's no previous state from which to pull position/size data.

 

Link to comment
Share on other sites

Hi @Leemoon

 

Could you explain what you're expecting the outcome to be? Are you trying to create an element that fades in when added to the DOM? If so you can do that without FLIP.

 

Flip stands for 'First, Last, Invert Play' - in order for it to work there needs to be a first and last state to animate between. If you're adding something to the DOM the first state is 'not existing' so there's no previous state to pull size or position from.

 

3 hours ago, OSUblake said:

If any of the targets provided are NOT found in the state object, they will be passed to the onEnter and not included in the flip animation because there's no previous state from which to pull position/size data.

 

  • Like 2
Link to comment
Share on other sites

It needs targets as Flip doesn't know about the new box.

 

Quote
targets String | Element | Array | NodeList - by default, Flip will use the same targets from the state object provided in the first parameter, but if you'd like it to only animate a subset of those, you can define them here as either selector text (".class, #id"), an Element, an Array of Elements, or a NodeList. If any of the targets provided are NOT found in the state object, they will be passed to the onEnter and not included in the flip animation because there's no previous state from which to pull position/size data.

 

See the Pen ZEKVwaZ by GreenSock (@GreenSock) on CodePen

 

 

 

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...