Hi i am trying to create a web page that works at different screen resolutions. At present i use a script that checks the resolution and loads a frameset accordingly. This is not economical as i have to produce three x amount of frames, per frameset (see below):
<script language="JavaScript">
var s800x600page = "index1.htm";
var s1024x768page = "index2.htm";
var s1152x864page = "index3.htm";
var pagetype;
if ((screen.height == 600) && (screen.width == 800)) {
pagetype = 1; }
else if ((screen.height == 768) && (screen.width == 1024)) {
pagetype = 2; }
else if ((screen.height == 864) && (screen.width == 1152)) {
pagetype = 3; }
else {
pagetype = 3; }
if (pagetype == 1) { window.location.href = s800x600page }
else if (pagetype == 2) { window.location.href = s1024x768page }
else if (pagetype == 3) { window.location.href = s1152x864page }
//-->
</script>
The only frame that changes in the frameset is main frame. Therefore i wonder if anyone can help me out with a script that checks the amount of screen available and resizes the mainFrame accordingly. Also is it possible to resize the mainFrame in relation to the favourites bar, so the screen will fit (i.e. no scrolling) even if the bar is pulled across the screen?
<script language="JavaScript">
var s800x600page = "index1.htm";
var s1024x768page = "index2.htm";
var s1152x864page = "index3.htm";
var pagetype;
if ((screen.height == 600) && (screen.width == 800)) {
pagetype = 1; }
else if ((screen.height == 768) && (screen.width == 1024)) {
pagetype = 2; }
else if ((screen.height == 864) && (screen.width == 1152)) {
pagetype = 3; }
else {
pagetype = 3; }
if (pagetype == 1) { window.location.href = s800x600page }
else if (pagetype == 2) { window.location.href = s1024x768page }
else if (pagetype == 3) { window.location.href = s1152x864page }
//-->
</script>
The only frame that changes in the frameset is main frame. Therefore i wonder if anyone can help me out with a script that checks the amount of screen available and resizes the mainFrame accordingly. Also is it possible to resize the mainFrame in relation to the favourites bar, so the screen will fit (i.e. no scrolling) even if the bar is pulled across the screen?