Recommend this page to a friend! |
Classes of Emmanuel Podvin | iFSM Animation | extlib/jquery.path/README.markdown | Download |
|
|
![]() jQuery.pathProvides animation along bezier and circular arcs. The animation engine in jQuery is focussed on single dimensional animation - hence it's difficult to animate two variables along a path. This simple plugin provides a method of multidimensional animation, and in particular provides a method for animating along bezier curves and arcs. BezierExample: animate along a bezier path <pre> var bezier_params = {
} $("my_elem").animate({path : new $.path.bezier(bezier_params)}) </pre> Bezier curves are made form a start point, an end point each with a control point
ArcExample: animate along an arc <pre> var arc_params = {
} $("my_elem").animate({path : new $.path.arc(arc_params)}) </pre>
Advanced ArcsExample: add a spiral to the arc <pre> var arc_params = {
} $('my_elem').animate({path : new $.path.arc(arc_params)}) </pre> Example: use another path as the center of the arc <pre> var bezier_params = {
} var arc_params = {
} $('my_elem').animate({path : new $.path.arc(arc_params)}) </pre> Example: combine both the spiral and center paths <pre> var bezier_params = {
} var arc_params = {
} $('my_elem').animate({path : new $.path.arc(arc_params)}) </pre> RotationRotation can be added to any path by specifying a rotator. Example: keep the top of the element facing forward on the path <pre> var bezier_params = {
} $("my_elem").animate({path : new $.path.bezier(bezier_params)}) </pre> Example: make the element spin <pre> var spin_params = {
} var bezier_params = {
} $("my_elem").animate({path : new $.path.bezier(bezier_params)}) </pre> Other PathsIt is trivial to create other paths, or even animate other parameters. E.g: <pre> var SineWave = function() { this.css = function(p) {
} }; $("my_elem").animate({path : new SineWave}) </pre> LinksCompatibilityTested in
|