Reading clientWidth in a loop sounds not very good for reflowing.