Forum Moderators: open

Message Too Old, No Replies

full screen if resolution is 800x600

         

lindajames

7:00 pm on Jul 25, 2004 (gmt 0)

10+ Year Member



hi everyone,

i want my users browser to become full screen if their resolution is 800x600 or lower. is it possible to do this via javascript? if so can anyone please help

cheers

Rambo Tribble

1:02 am on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't have a small screen to test this on, but it should work:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
window.onload=function(){
var scr_wd=screen.availWidth;
var scr_ht=screen.availHeight;
if(scr_wd+scr_ht<1401){
window.moveTo(screen.availLeft,screen.availTop);
window.resizeTo(scr_wd,scr_ht);
}
}
</script>
</head>
<body>
</body>
</html>

encyclo

1:11 am on Jul 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The above code will probably work - but I'd strongly recommend you don't use it - there are few things worse than a website resizing the window. It is very invasive, especially if someone has their windows arranged just how they like it. Personally, if I come accross a site which changes the window size, I can't click the back button quick enough - never to return. I think you'll find that a lot of your users will do the same.

Rather than forcing the window size, you should look at creating a more fluid layout for your site.

Squashua

6:25 pm on Jul 26, 2004 (gmt 0)

10+ Year Member



Encyclo, though your points are valid, you're responding from the field of "don't actually know where the end application will be used". I've had to write pretty much the same thing for an internal, company-only application once.

They didn't mind because they expected it; outsiders were never going to see it.

Though yes, I too tend to close a browser window when it takes over my whole screen. Especially when I'm browsing from work.