Finally, an easy way to animate elements and jump around on your page.
It has different easing functions (listed below) and tries (by default) to use CSS-Transitions to animate elements.
If the browser doesn't support transitions, force.js fallback to native javascript functions.
Force.js support even older browser version with no transition support.
To use it on your page, just write this line of code in the HTML HEAD
or on the bottom of the BODY
tag.
<script src="force.js" type="text/javascript"></script>
Support for AMD and Node Module Pattern (Including browserify)
Get it on Bower
bower install force-js
Get it via cdnjs
Just copy and paste it into your project.
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/force-js/0.1.3/force.min.js"></script>
Go to the force-js page on cdnjs.
jQuery
Force.js is 100% pure vanilla!!!
But for all the coders who don't want to miss jQuery.
Force.js automatically detects jQuery and extend its Objects with the force.move() and force.jump() function.
So you are able to use force.js in an jQuery object.
$('#ball').move({left: 100px, top: 50px}, 1000);
To use force.js in jQuery, write the jQuery TAG first. So force.js can extend its objects afterwards.