maccman / jquery.magicmove Goto Github PK
View Code? Open in Web Editor NEWAnimate DOM transitions.
Home Page: http://maccman.github.io/jquery.magicmove/
Animate DOM transitions.
Home Page: http://maccman.github.io/jquery.magicmove/
Hi! would love to use your package. What's the usage license?
Nice plugin, Alex. Can you add a link to the blog post and/or demo from the repo description and/or README file? I'm planning to feature this in my newsletter and I normally only include the direct link to the GH repo. I think it will help others sharing it, too. Thanks!
Swapping the positions of two elements works during the animation. Immediately afterwards, when the elements are unfixed, they return to their original position (because their DOM positions haven't changed).
In the library-provided demo, using the following callback in magicMove
will replicate this issue.
let $sections = $(this).find('section');
let i = Math.floor(($sections.length - 1) * Math.random());
$($sections[i]).insertAfter($sections[i + 1]);
Actually calculating the swap seems harder - perhaps making the following change in the .done()
of the magicMove
function could be the easiest solution? It works for the provided example and this swapping example, happy to log a pull request if you're happy with it.
return promise.done(function () {
// make the DOM a mirror of the cloned DOM
$el.html($clone.html());
// Remove 'absolute' styles
$unfix.call($el.find(options.selector));
});
Not sure if this is a bug or if the library is not supposed to cover this specific use case but when I remove an element, this is what happens:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.