Swipe overrun maths

by Ben Clayton

HTML

<div id="ball"></div>

CSS

#ball {position:absolute;border-radius:50%;width:20px;height:20px;background-color:red;}

JavaScript

var s=30;// initial speed
var d=0;

function ticker(){
    s=s*0.9
    d=d+s;
    $('#ball').css('left',d);
    setTimeout(ticker,100);
}


ticker()