why won't this script work
Hi there
I've just dug out this script but I'm not sure what it's supposed to do - can anyone help? I think it's supposed to scale images depending on the resolution of the computer screen but when I try it, it doesn't seem to work. Can anyone shed some light on it: here it is; I've included all the html code too.
<%@ language=VBScript %>
<% option explicit %>
<HTML>
<HEAD>
<TITLE>Untitled-1</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<%
Sub SetScaleFactor(ByRef sngSFw, ByRef sngSFh, ByVal strWidth, ByVal strHeight, ByVal strDefWidth, ByVal strDefHeight)
if (strWidth <> "") and (strheight <> "") then
sngSFw = Csng(strWidth) / Csng(strDefWidth)
sngSFh = Csng(strheight) / Csng(strDefHeight)
else
sngSFw = 1.0
sngSFh = 1.0
end if
End Sub
%><%
'Sets the Scaling Factor
Call SetScaleFactor(sngSFw, sngSFh, request.querystring("width"), request.querystring("height"), BASE_WIDTH, BASE_HEIGHT)
Const BASE_WIDTH = "800"
Const BASE_HEIGHT = "600"
dim sngSFw, sngSFh
%>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<td width="100%" height="100%" align="center" valign="top">
<table width="<%=cint(991*sngSFw)%>" height="<%=cint(110*sngSFh)%>" border="0" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="2" width="<%=cint(362*sngSFw)%>" height="<%=cint(110*sngSFh)%>"><img src="../images/slices_01.gif" width="100%" height="100%"></td>
<td valign="top" width="<%=cint(337*sngSFw)%>" height="<%=cint(110*sngSFh)%>"><img src="../images/slices_02.gif" width="100%" height="100%"></td>
<td rowspan="2" width="<%=cint(292*sngSFw)%>" height="<%=cint(110*sngSFh)%>"><img src="../images/slices_03.gif" width="100%" height="100%"></td>
</tr>
</table>
</td></tr>
</table>
</HTML>
|