why not element.style.opacity = 0 ? does the position affect the display if display: none isn't used?