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
#friends { position: absolute; }
Markup
<img src="http://jsfiddle.net/img/logo.png"
id="friends"/>
JS
function moveit() {
var newTop = Math.floor(Math.random()*350);
var newLeft = Math.floor(Math.random()*1024);
var newDuration = Math.floor(Math.random()*5000);
$('#friends').animate({
top: newTop,
left: newLeft,
}, newDuration, function() {
moveit();
});
}
$(document).ready(function() {
moveit();
});
Live demo: http://jsfiddle.net/W69s6/embedded/result/
Any Suggestion??
Another variant (based on Div Moving in cycle rotation using Javascript):
DEMO: http://jsfiddle.net/W69s6/20/