Lateral motion of a slender body between two parallel walls