resizing windows according to OS/browser/resolution?

This is a discussion on "resizing windows according to OS/browser/resolution?" within the JavaScript Forum section. This forum, and the thread "resizing windows according to OS/browser/resolution? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 8th, 2006, 11:34
Junior Member
Join Date: Feb 2006
Location: West Yorks, UK
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Question resizing windows according to OS/browser/resolution?

I have a window which is opened as a pop-up by a JavaScript. On my Mac, it opens fine, but on Windows, it seems it doesn't even open wide enough for the complete graphic, let alone for the text at the bottom.

Is there any way I can open the window at different sizes according to OS/browser/screen resolution? Or is this idea a can of worms?

Pop-up window (617.html):

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Taco HTML Edit">
<link rel="stylesheet" href="../../styles.css" type="text/css">
<title>61/7 - Insular Motif - Ribblehead</title>
</head>
<body>
<table class="picture_popup" summary="line-up table">
<tr>
<td>
<img src="617.gif" alt="61/7 - Insular Motif - Ribblehead" width="566" height="395" border="0">
</td>
</tr>
<tr>
<td>
<div class="sizesmaller">
<b><i>61/7 - Insular Motif - Ribblehead - Water-Colour - 880x620 - 1991</i></b>
<br><br>
<b><a href="#" onclick="javascript:window.close();">CLOSE WINDOW</a></b>
</div>
</td>
</tr>
</table>
</body>
</html>


javascript:

<script language='javascript' type="text/javascript">
//-- this function opens the new, empty window named floater, h=500,w=500
function openWindow(url,iW,iH) {
winStats='toolbar=no,location=no,directories=no,me nubar=no,'
winStats+='scrollbars=yes,width=' + iW + ',height=' + iH
if (navigator.appName.indexOf("Microsoft")>=0) {
winStats+=',left=10,top=10'
}else{
winStats+=',screenX=10,screenY=10'
}
floater=window.open(url,"",winStats)
}
//-->
</script>

Calling the script:

<a href="javascript:openWindow('Gallery/Watercolours/617.html',590,470);">(61/7) Ribblehead</a>

CSS classes:

.picture_popup {
margin: 10px;
}
.sizesmaller {
font-size: smaller;
text-align: center;
}
Reply With Quote

  #2 (permalink)  
Old Feb 8th, 2006, 12:50
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: resizing windows according to OS/browser/resolution?

IE has its own method for setting the height and width of a window. You have to define var's iH and iW after the body tag:

Code: Select all
  <script> 
iW = document.body.clientWidth; 
iH = document.body.clientHeight; 
alert("Inner Width: " + iW + "px  Inner Height:" + iH); 
</script>

IE recognizes this method for resizing the window:

Code: Select all
 self.resizeTo(500,500);
There are two more IE methods worth noting in this area:

Code: Select all
 self.moveTo(x, y); 
self.moveBy(x,y);
Reply With Quote
  #3 (permalink)  
Old Feb 8th, 2006, 16:43
Junior Member
Join Date: Feb 2006
Location: West Yorks, UK
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Re: resizing windows according to OS/browser/resolution?

Thank you very much. I'll try those out. :-)
Reply With Quote
Reply

Tags
resizing, windows, according, osbrowserresolution

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Resizing text in a browser Nimster Web Page Design 2 Nov 7th, 2007 11:50
Cross browser and resolution compatability? Powelly Web Page Design 2 Jun 8th, 2007 14:20
How can I know the user's resolution QuikFrozen JavaScript Forum 5 Aug 9th, 2006 15:03
Resolution Fix Udabar JavaScript Forum 6 Apr 10th, 2006 02:23
Two problems - image alignment and new browser windows. DrRedSkwirrell Web Page Design 9 Oct 29th, 2005 00:51


All times are GMT. The time now is 10:44.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43