Comments (2)
I think the flipped element fires a "flipComplete" custom Event at the end that you can handle via addEventListener.
from flipjs.
Thanks. The flipComplete
will tell you which/when element has finished FLIPing, but not which animation has just finished. For example, if I had a single element which could be FLIP'd in a few ways sequentially (.flip-left
, .flip-down
and .flip-fade
), the only way of telling which has just happened is to check the FLIP or element target's classList.
const animateShape = document.querySelector('.flip-el');
const flip = new FLIP({
element: animateShape,
duration: 500
});
flip.snapshot('flip-left');
flip.play();
animateShape.addEventListener('flipComplete', flipEvent => {
// flipEvent.target.classList
});
From there, I guess you could infer and FLIP the next intended animation? Starts to get hairy once there's more than a couple of FLIPs involved. I may be missing an obvious solution here...
from flipjs.
Related Issues (13)
- Write some tests.
- Non-Minified /dist/ file HOT 1
- Submit to NPM HOT 2
- Callback functions
- GSAP Support
- The demo url does not work 😭 HOT 2
- Why is this project in googlearchive? HOT 1
- Fails if flipped element has css transforms. HOT 2
- Allow users to abort animations.
- Dispatch only one flipcomplete event for groups HOT 1
- Support for Shared Element Transitions
- Support for NPM
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flipjs.