Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: Relative window size function
From: Branden Hall
Date: Fri, 25 Feb 2000 18:51:41 GMT

Hey folks... Last night I wrote this little function for a project I was
doing and figured someone out there might find it handy. It will take in the
size of the window you want popped up at 640x480 resolution, and if the
users monitor is set to something higher it will pop it up relative to that
size, with the aspect ration staying the same.

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="JavaScript">
function openRelativeWindow(theURL, theName, baseWidth, baseHeight){
aspectRatio = (baseWidth/baseHeight);
calcWidth = (screen.width/640)*baseWidth;
calcHeight = calcWidth / aspectRatio;
window.open (theURL, theName, 'width='+calcWidth+',
height='+calcHeight);
}
</script>
<body bgcolor="#FFFFFF">
<a href="#" onClick="openRelativeWindow('http://www.figleaf.com', 'fig',
400, 200)">Click to Launch</a>
</body>
</html>

Just do like I did with the link. The first option is the URL, the second
the name of the window, the third the base width and the last the base
height.
The base values are for 640x480.

-= Branden J. Hall
-= Multimedia Developer/Instructor
-= Fig Leaf Software



flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World’s Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California

-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]