$(document).ready(function(){ var deg=0; /* storing all the images into a variable */ var images = $('#stage img').removeclass('default').addclass('animationready'); var dim = { width:images.width(),height:images.height()}; var cnt = images.length; /* finding the centers of the animation container: */ var centerx = $('#stage').width()/2; var centery = $('#stage').height()/2 - dim.height/2; function rotate(step,total){ // this function loops through all the phone images, and rotates them // with "step" degrees (10 in this implementation) until total has reached 0 /* increment the degrees: */ deg+=step; var esin,ecos,newwidth,newheight,q; /* loop through all the images: */ for(var i=0;i