jquery.transit
Super-smooth CSS3 transformations and transitions for jQuery
A jQuery plugin that adds smooth CSS3 transform and transition animations to web pages, letting you rotate, scale, and move elements using familiar jQuery syntax with browser-native rendering performance.
jQuery Transit is a plugin that adds smooth animation capabilities to jQuery, a widely used JavaScript library for working with web pages. It focuses on CSS3 transformations and transitions, which are animation techniques the browser handles directly rather than JavaScript calculating each frame. Because the browser's graphics layer does the work, these animations tend to run more smoothly than equivalent JavaScript-driven animations.
The plugin extends jQuery's standard .css() method so you can set properties like position, rotation, scale, and skew the same way you would set any other CSS property. You can move an element to the right, rotate it by 30 degrees, or scale it to twice its original size using the same syntax jQuery developers already know. Relative adjustments also work, so you can rotate an element 30 degrees more from its current position without tracking its state manually. Getting the current value of any of these properties is also supported.
For animating between states, the plugin provides a .transition() method that works like jQuery's built-in .animate() method but uses CSS3 transitions instead. You specify a duration, an easing curve, and an optional callback function to run when the animation finishes, using the same argument pattern that .animate() accepts.
Three-dimensional transformations are supported where the browser allows them, including rotations around the X and Y axes and perspective effects.
The plugin requires jQuery version 1.4 or higher and is added to a page with a single script tag after the jQuery include. It is available through both npm and bower.
Where it fits
- Add smooth rotation, scaling, and position animations to a web page without writing raw CSS or tracking element state manually.
- Replace choppy JavaScript-driven animations with browser-native CSS3 transitions using the same jQuery code patterns you already know.
- Create 3D flip and perspective effects on page elements with a single .transition() call.