I think the sine? Assuming jh is the "transition height" and jw is the "distance" without clearing the existing code, you can do something like this:
var y = 300; var x = 0; var jh = 100; var jw = 200; var c = 0; var speed = 3; var inter = setInterval(function () { c++; y = getHeightAtX(x); if (x >= jw) clearInterval(inter); x+=speed; $('.box').css({ 'bottom': y + 'px', 'left': x + 'px' }); }, 20); function getHeightAtX(x) { return jh*Math.sin(x*Math.PI/jw) };
source share