Giter Club home page Giter Club logo

Comments (2)

Pesthuf avatar Pesthuf commented on August 18, 2024

I think the flipped element fires a "flipComplete" custom Event at the end that you can handle via addEventListener.

from flipjs.

adamduncan avatar adamduncan commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.