Here i am trying to make an image move in a circular path but it is not moving in a circular path..I have tried like this Moving a picture around slowly
CSS
Another variant (based on Div Moving in cycle rotation using Javascript):
var t = 0;
function moveit() {
t += 0.05;
var r = 100; // radius
var xcenter = 100; // center X position
var ycenter = 100; // center Y position
var newLeft = Math.floor(xcenter + (r * Math.cos(t)));
var newTop = Math.floor(ycenter + (r * Math.sin(t)));
$('#friends').animate({
top: newTop,
left: newLeft,
}, 1, function() {
moveit();
});
}
$(document).ready(function() {
moveit();
});
DEMO: http://jsfiddle.net/W69s6/20/