using getBoundingClientRect instead of setTimeout to fix animation
fixes for Firefox