Since you apply the currentHeight to fixedContainer's offsetHeight, there is no need to update the height inside the loop, right?