Dynadot

Is this possible in JavaScript?

Spaceship Spaceship
Watch
Impact
1
>:( Does anyone know how to set the current window to fullscreen with JavaScript? :-/ I want the current window to be fullscreen WITHOUT opening a new window... :-/
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
if this is for a website going going public why wud u want to annoye your visiter making the window auto-maximise? I'd probably close the page if it did that?

nick
 
0
•••
>:( Fullscreen mode is optional so there is no forcing involved. Anyway, I figured out how to do it myself.

var screensettings = "small"

function screenchange()
{
if (screensettings == "small")
{
if (document.layers)
{
if (top.window.innerWidth == screen.width)
{
alert("Window cannot be maximized when entering fullscreen mode.");
} else {
screensettings = "big";
fullscreen()
}
} else {
if (top.document.body.offsetWidth == screen.width)
{
alert("Window cannot be maximized when entering fullscreen mode.");
} else {
screensettings = "big";
fullscreen()
}
}
} else {
screensettings = "small";
restore()
}
}

function fullscreen()
{
if (document.layers)
{
top.window.resizeTo(screen.width+20,screen.height+300);
top.window.moveTo(-10,-100);

} else {
top.window.resizeTo(screen.width+20,screen.height+300);
top.window.moveTo(-10,-100);
}
}

function restore()
{
if (document.layers)
{
top.window.resizeTo(200,200);
top.window.moveTo(0,0);
} else {
top.window.resizeTo(200,200);
top.window.moveTo(0,0);
}
}
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back