NameSilo

Is this possible in JavaScript?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
Watch

Mp)Tarh

Established Member
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
>:( 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
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back