Is there a way to accomplish this? To start, take a look at the following code...
function flutter() {
var random = Math.floor(Math.random()*5);
var $obj = $('.bird');
$obj.animate({ top :'-=' + random + 'px' }, 20, flutter);
}
</script>
In the above code snippet, my objective is to reverse the value of random when the callback is executed. The end goal is to create a fluttering effect by moving the Class bird up and down.