Jump to content

Recommended Posts

Posted (edited)

Hi all,

 

I wrote a javascript code (see below :) ) and it works to a degree. What it does is check the user's screen width and choose a size for the window to be resized to according to that resolution. Well, the width is always dead-on, but some resolutions have differing heights for the same width setting. So, is there a more efficient way to resize the window to be full screen without using all that code below?

 

>var win_width = (screen.width);

switch (win_width){
case 480:
window.self.moveTo(0,0);
window.self.resizeTo(640,430);
break;

case 800:
window.self.moveTo(0,0);
window.self.resizeTo(800,550);
break;

case 1024:
window.self.moveTo(0,0);
window.self.resizeTo(1024,718);
break;

case 1152:
window.self.moveTo(0,0);
window.self.resizeTo(1152, 814);
break;

case 1280:
window.self.moveTo(0,0);
window.self.resizeTo(1280, 950);
break;

case 1600:
window.self.moveTo(0,0);
window.self.resizeTo(1600,1150);
break;

default:
window.self.moveTo(0,0);
break;
}

 

many thanks,

!!blue

 

Edited by !!blue
Posted

Here is a very simple one that I use for my site.

><script language="javascript"> 
<!-- 
window.moveTo(0,0) 
window.resizeTo(screen.availWidth,screen.availHeight) 
//--> 
</script>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...