javascript - Getting non scrolling height of the viewport -
I want to know the current view port or the height of the screen that is currently shown, this means that if some parts of the page If it has not been shown due to being overflowing, then it should not be included in it.
All of the following gave me similar results, including scrolling / non-visible areas -
$ (document). height (); $ (Windows) .height (); Document.body.clientHeight; Can anybody please tell me how to know the height of the current visible area of the document in JS or JQ?
I can not find your problem $ (window) .hit ()
To scroll down, you should return the height of the viewport, leaving anything you need, if you take a look at it, you will read:
// The height of the browser viewport is $ (window) .height (); // HTML Document returns the height of $ (document). height ();
An option is using window.innerHeight
. But it returns the same as the $ (window). To get the height of the screen, you can use the screen.height
() to height ()
to me
. This will return the height of the entire screen (including the top bar of the browser and the windows taskbar). screen.availHeight
In contrast, only the top bar of the browser is included.
Comments
Post a Comment