typing javascript animation (in a jquery plugin)