fixed the animation for visible elements only