The kAnim plugin for jQuery is designed to give a more organic feeling to the animation of multiple elements. Instead of the elements being animated simultaneously, as with animate(), or in succession, kAnim animates successive elements in overlapping intervals.
It can be downloaded here: http://www.digitalbutter.com/static/js/jquery.kAnim.js
$(selector).kAnim( animationParameters, duration, order, callback, overlap )
kAnim takes up to 5 arguments. All arguments are optional except the first.
The parameters supplied function identically to those in the jQuery animate function in dealing with css properties.
Names of built-in presets can also be entered as a string the first argument. Those presets are:
appear
disappear
horizontalAppear
horizontalDisappear
horizontalSlideIn
horizontalSlideOut
verticalAppear
verticalDisappear
verticalSlideIn
verticalSlideOut
The target total time of animation in milliseconds
The order by which the selected elements will be sequentially animated. The three options are: "normal","random","reverse". Normal order is ascending order. Random is random. Reverse is descending order.
A function to run when the animation completes.
The amount of temporal overlap between each object and its successor. If the duration is 1000ms and there are 10 elements being sequenced, the frequency for each object without overlapping would be every 100ms. If the overlap is set to .9, each elements animation will be overlapped by its successor by 90%, meaning that 10% of the way through the first animation, the next will start, and so on. The default overlap value is .5, and the range of numbers allowed is 0.0-1.0.
$(selector).kAnim("appear");$(selector).kAnim("horizontalAppear",3000);$(selector).kAnim("verticalAppear");
and $(selector).kAnim("verticalSlideIn")$(selector).kAnim("disappear",1000,"random",function(){
$(this).kAnim("appear",600,"reverse");
});$(selector).kAnim("disappear",2000,"reverse",function(){
$(this).kAnim("appear",2000,"normal",null,.9);
},.1);
});
$(selector).kAnim("horizontalDisappear",2000,"reverse",function(){
$(this).kAnim("appear",2000,"random",function(){
$(this).kAnim("verticalSlideOut",2000,"reverse",function(){
$(this).kAnim("horizontalSlideIn",2000);
},.05);
});
});
$(selector).kAnim({"width":"100px","height":"100px"},2000,"normal",function(){
alert("done!");
},.7);