Using jQuery to animate the CSS changes instead of CSS transitions. CSS transitions were causing miscalculations.