I can get the size of the overall screen, but is it possible to get the current window size of the browser?
Printable View
I can get the size of the overall screen, but is it possible to get the current window size of the browser?
do you mean the displayable region of the page or the overall window size ?
Hello again, I mean the displayable region. If I set my screen res to 1024*768, but change my browser window size, its that I'm trying to get.
Netscape only, as yet I've never found a way of determining it in IE :mad:
Code:<script>
if (document.all){
alert("i dunno guv, it's a mystery");
}else{
alert(window.innerWidth + " x " + window.innerHeight);
}
</script>
found it! :D
This is how you do it in IE and Netscape.
It needs to be in an onload event or the ie version wont work!
Next! ;)Code:<script>
function getWindowStats(){
if (document.all){
alert(document.body.clientWidth + " x " + document.body.clientHeight);
}else{
alert(window.innerWidth + " x " + window.innerHeight);
}
}
</script>
<BODY onload="getWindowStats()">
Many thanks, saved me some headaches