[jQuery] Retrieve viewport height
Hi all,
is there already a function in jQuery to retrieve the viewport's height?
I wrote a "plugin" for that, nothing spectactular and maybe it's already
in jQuery anyway...:
// Return the available content height space in browser window
$.viewportHeight = function() {
var h = 0;
if (typeof(window.innerHeight) == "number") {
h = window.innerHeight;
} else {
if (document.documentElement &&
document.documentElement.clientHeight) {
h = document.documentElement.clientHeight;
} else {
if (document.body && document.body.clientHeight) {
h = document.body.clientHeight;
}
}
}
return h;
}
Happy Coding
--Klaus
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/