PDA

View Full Version : Detecting full-screen


peetm
06-28-2002, 10:05 AM
I have two versions of my site - one runs full-screen, the other in a regular browser window. However, I'd like to offer certain features in one or the other 'modes' only - like a seperate 'Nav' section when running full-screen.

So, how do I detect whether a window is fullscreen or not?

Many thanks,

peetm

peetm
06-28-2002, 02:29 PM
I've never heard of document.offsetWidth etc - I'm guessing that, if these are zero, the the point 0, 0 of the client-area is at the screen co-ord 0, 0 too??

Is that right as it sounds as though that might work for me.

What I need is someway to do that - to test whether 0, 0 is at screen co-ord 0, 0 I guess.

peetm

Quiet Storm
06-28-2002, 05:12 PM
<SCRIPT LANGUAGE="JavaScript">
if (this.name!='fullscreen'){
document.write('This is in Fullscreen!');
}
</SCRIPT>

joh6nn
06-28-2002, 05:40 PM
in my own personal experience, the window name hardly ever comes into use, except with popups and frames. i think i'd solve this issue, by setting the window's name when the decision for fullscreen or normal happens. then, you could check to see what the window's name is, and go on that.

KrazyKid
08-01-2002, 06:51 PM
Is there a way to determine the value of "fullscreen" once a window has been opened to fullscreen?

I want to be able to only enlarge the window to say:

fullscreen / 2;


Thanks!

Quiet Storm
08-01-2002, 08:54 PM
If you want a ½ fullscreen, that would be a "Chromeless"-type window. Visit http://www.microbians.com for more information.

KrazyKid
08-01-2002, 09:39 PM
I really want to know what the end-user's resolution is so that I don't resize a window too large for the screen...

BTW QuietStorm: I didn't see the example at the link that you posted...thanks anyway!

KrazyKid
08-06-2002, 08:59 PM
What is the best way to determine the current size of the user's window?

I want to grab the value to set it and then set it back to the original value......

Thanks!

KrazyKid
08-07-2002, 02:24 PM
Ok I have seen many ways to determine the max screen size but I have not found the way to retrieve the value of the current window size using Internet Explorer...

Any ideas?!?!
:confused:

premshree
08-07-2002, 05:12 PM
Here is a script I use for my site at http://www.qiksearch.com/premshree


////////////////////////////////////////////////////
///// Bust It! : Full-Screen Buster JavaScript /////
////////////// Created on 24 May 2002 //////////////
// (c) 2002 Premshree Pillai. All rights reserved //
///////////// http://www.qiksearch.com /////////////
////////////////////////////////////////////////////

var ie4_t=document.all&&navigator.userAgent.indexOf("Opera")==-1;
var ns6_t=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;
var ns4_t=document.layers;

var x1_test=document.body.clientWidth==screen.width;
var x2_test=document.body.clientHeight==screen.height;

function BustIt()
{
if(!ie4_t)
{
window.self.close();
}
if(ie4_t)
{
if(!(x1_test&&x2_test))
{
alert('This page is optimised for Full-Screen View.');
this.window.close();
window.open('home.htm','Welcome','fullscreen=yes, scrollbars=auto');
}
}
}

window.onload=BustIt;


Make the modifications to your needs.

:thumbsup:

KrazyKid
08-07-2002, 07:27 PM
Do you know how to return the value of the current size of the client window?

Using IE
Let's say the window was opened at 400,400.

Can you confirm that the window size is 400,400?

Thanks!

premshree
08-08-2002, 06:17 AM
<script language="JavaScript">
if((document.body.clientWidth==400) && (document.body.clientHeight==400))
{
//Do something
}
else
{
//Do something
}
</script>


:thumbsup:

KrazyKid
08-08-2002, 07:56 PM
I want to be able to set variables to the current size of the window in relation to the user's window height and the user's window width

var currHeight = Some_DOM_compatible_window_height_value;
var currWidth = Some_DOM_compatible_window_width_value

Then your suggestion would work! ;)
if((document.body.clientWidth==currWidth) && (document.body.clientHeight==currHeight))


I am sure that there has to be a way to do this within IE...

Can someone please enlighten us all!

Thanks!