ChrisQuick
Programmer
I have a page that contains a few photos. I want the photos to be different sizes based on the users screen resolution. The code I have now works fine in IE, but doesn't seem to work in NS. Any ideas how to make it work?
I am defining the images like this in the page:
and triggering a javascript function in the body OnLoad event to change the source and dimensions. This is my code:
cquick@geotg.com
Geographic Information System (GIS), ASP, some Oracle
I am defining the images like this in the page:
Code:
<CENTER>
<IMG NAME="conference2" SRC="images/spacer1.gif" ALT="" width="190" height="127"><BR>
<IMG SRC="images/spacer1.gif" ALT="" WIDTH="190" HEIGHT="5"><BR>
<IMG NAME="conference3" SRC="images/spacer1.gif" ALT="" width="190" height="127"><BR>
<IMG SRC="images/spacer1.gif" ALT="" WIDTH="190" HEIGHT="5"><BR>
<IMG NAME="conference4" SRC="images/spacer1.gif" ALT="" width="190" height="127"><BR>
</CENTER>
and triggering a javascript function in the body OnLoad event to change the source and dimensions. This is my code:
Code:
<SCRIPT TYPE="text/javascript" language="JavaScript">
function loadConferencePics(){
if (document.images) {
var winWidth = screen.width;
var winHeight = screen.height;
if ((winWidth == 800) && (winHeight == 600)){
document.images.conference2.src = "images/getConf2_500.jpg";
document.images.conference2.width = 330;
document.images.conference2.height = 220;
document.images.conference3.src = "images/getConf3_500.jpg";
document.images.conference3.width = 330;
document.images.conference3.height = 220;
document.images.conference4.src = "images/getConf4_500.jpg";
document.images.conference4.width = 330;
document.images.conference4.height = 220;
}
if ((winWidth > 800) && (winHeight > 600)){
document.images.conference2.src = "images/getConf2_640.jpg";
document.images.conference2.width = 420;
document.images.conference2.height = 280;
document.images.conference3.src = "images/getConf3_640.jpg";
document.images.conference3.width = 420;
document.images.conference3.height = 280;
document.images.conference4.src = "images/getConf4_640.jpg";
document.images.conference4.width = 420;
document.images.conference4.height = 280;
}
}
}
</SCRIPT>
Geographic Information System (GIS), ASP, some Oracle