With the help of the canvas, you will want to use the same technique as in this post, except for using several frames and erasing / drawing a rectangle in each frame. Pseudocode:
setTimeout(1000/30, function () {
canvas.erase()
rect.update_position()
canvas.drawRect(rect)
})
, Box2dWeb, , "flicking" - http://code.google.com/p/box2dweb/