|
-
Nov 27th, 2001, 08:40 AM
#1
Thread Starter
Hyperactive Member
Browser size
I can get the size of the overall screen, but is it possible to get the current window size of the browser?
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Nov 27th, 2001, 10:01 AM
#2
Hyperactive Member
do you mean the displayable region of the page or the overall window size ?
-
Nov 27th, 2001, 10:05 AM
#3
Thread Starter
Hyperactive Member
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.
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Nov 27th, 2001, 10:35 AM
#4
Hyperactive Member
Netscape only, as yet I've never found a way of determining it in IE
Code:
<script>
if (document.all){
alert("i dunno guv, it's a mystery");
}else{
alert(window.innerWidth + " x " + window.innerHeight);
}
</script>
-
Nov 27th, 2001, 10:53 AM
#5
Hyperactive Member
found it!
This is how you do it in IE and Netscape.
It needs to be in an onload event or the ie version wont work!
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()">
Next!
-
Nov 27th, 2001, 10:55 AM
#6
Thread Starter
Hyperactive Member
Many thanks, saved me some headaches
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|