JavaScript - Check if absolute coordinates (left, top, right, bottom) are going to be visible on the current viewport
<p>Hey guys I have an absolute position for an element that will be created in the future. I want to check if the element is going to be entirely visible on the current viewport. I know I could use <code>getBoundingClientRect</code> if the element was rendered on the page, however it's not and it couldn't not be. Is there a way that I can detect if given absolute coordinates (left, top, bottom, right) are going to be visible on the current viewport? Thanks in advance.</p>

<p>Edit:</p>

<p>My solution so far - insert an element with <code>visibility: hidden</code> and use <code>getBoundingClientRect</code>, I was just wondering if there is a better way.</p>
