Avoid checking the document & window width and height on every scroll