10 examples of 'document documentelement clientheight' in JavaScript

Every line of 'document documentelement clientheight' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
51export function getWindowHeight() {
52 if (!executionEnvironment().canUseDOM) {
53 return 0;
54 }
55 const w = window;
56 const d = document;
57 const e = d.documentElement;
58 const g = d.getElementsByTagName('body')[0];
59 return w.innerHeight || e.clientHeight || g.clientHeight;
60}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

44get clientHeight() {
45 return 0;
46}
325function getBrowserHeight () {
326 if (document.documentElement && document.documentElement.clientHeight) {
327 return document.documentElement.clientHeight;
328 } else if (window.innerHeight) {
329 return window.innerHeight;
330 } else if (document.body && document.body.clientHeight) {
331 return document.body.clientHeight;
332 } else if (document.body && document.body.offsetHeight) {
333 return document.body.offsetHeight;
334 }
335 return 0;
336}
61get height() {
62 return this.element.clientHeight;
63}
115function getWindowHeight() {
116 var myHeight = 0;
117 if (typeof( window.innerHeight ) == 'number') {
118 //Non-IE
119 myHeight = window.innerHeight;
120 } else if (document.documentElement && document.documentElement.clientHeight) {
121 //IE 6+ in 'standards compliant mode'
122 myHeight = document.documentElement.clientHeight;
123 } else if (document.body && document.body.clientHeight) {
124 //IE 4 compatible
125 myHeight = document.body.clientHeight;
126 }
127 return myHeight;
128}
107function getWindowHeight() {
108 if (window.innerHeight) {
109 return window.innerHeight;
110 } else if (document.documentElement && document.documentElement.clientHeight) {
111 return document.documentElement.clientHeight;
112 } else if (document.body) {
113 return document.body.clientHeight;
114 }
115 return 0;
116}
23function getWindowHeight() {
24 return window.innerHeight ||
25 document.documentElement.clientHeight ||
26 document.body.clientHeight || 0;
27}
40function H() {
41 return (isNetscape() ? window.innerHeight-2 : document.body.clientHeight);}
56get contentHeight(): number {
57 return this.contentWrapperElement.clientHeight;
58}
97export function normalizedHeight(el: Element): number {
98 if (isDocumentElement(el)) {
99 return window.innerHeight;
100 }
101
102 return el.clientHeight;
103}

Related snippets