Click to See Complete Forum and Search --> : Detecting fullscreen
kpn
Jan 12th, 2001, 07:59 PM
I've opened a page like this:
window.open("test.php","","fullscreen,scrollbars")
Can I in any way tell the user if he's running fullscreen or normal window? Like detecting it with javascript or something like that?
Mark Sreeves
Jan 15th, 2001, 04:44 AM
I don't think there is an easy way of detecting weather a page is full screan or not but if I open a window full screen with this code in it:
<html>
<head>
<script Language='JavaScript'>
if (window.screen) {
document.write("Screen width: " + window.screen.availWidth);
document.write("Screen height: " + window.screen.availHeight);
}
if (document.layers) {
width = window.innerWidth;
height = window.innerHeight;
}
else if (document.all) {
width = document.body.clientWidth;
height = document.body.clientHeight;
}
document.write("Page width: " + width);
document.write("Page height: " + height);
</script>
</head>
<body>
</body>
</html>
the output is:
Screen width: 1024
Screen height: 740
Page width: 1024
Page height: 768
so, what you could do is just do a comparision between screen size and page size and if screen size is a lot bigger than page size, then you know the page isn't being displyed fullscreen.
I hope this has been of help to you.
Mark Sreeves
Jan 17th, 2001, 02:50 AM
DID MY LAST REPLY HELP?
If you don't give me any feed-back I won't bother answering your questions in future!!
kpn
Jan 18th, 2001, 06:47 AM
I'm sorry. I hadn't had time until now testing it. It helped me. But I left that fullscreen thing. Thanks for the help.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.