Click to See Complete Forum and Search --> : screen resolution
jackbobpin
06-04-2003, 07:21 PM
I use the 1024 x 768 screen resolution and I have frames on my site... I have my site logo inside the frame, but when i changed the resolution to 800 x 600 to check out how the site looked, the image didn't fit on the frame. Is there a way to make the image fit well in both resolutions without having to make the image smaller or changing the frame percentage? (when it's smaller, you can't see the picture as well)
Thank you very much.
--mR. redniP
You could do this:
<script language="javascript" type="text/javascript">
if (screen.width <= 800) {
document.myimage.src = "your800img.gif";
}
</script>
</head>
<body>
<img src="your1024img.gif" name="myimage" />
jackbobpin
06-05-2003, 12:17 AM
hmmm... that didn't seem to work... i'm probably just changing the wrong thing :rolleyes: I wouldn't be surprised :confused:
Oops... you need to put it in an onload event:
<script language="javascript" type="text/javascript">
function swapImage() {
if (screen.width <= 800) {
document.myimage.src = "your800img.gif";
}
}
</script>
</head>
<body onload="swapImage();">
<img src="your1024img.gif" name="myimage" />
jackbobpin
06-05-2003, 01:44 PM
well that still didn't work... let me make sure i'm changing the right thing: "your800image.gif" and "your1024image.gif" and that's all? sorry... i'm dumb :(
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="javascript" type="text/javascript">
function swapImage() {
if (screen.width <= 800) {
document.myimage.src = "800.gif";
}
}
</script>
</head>
<body onload="swapImage();">
<img src="1024.gif" name="myimage" />
</body>
</html>
havik
06-06-2003, 12:59 AM
I think pyro is saying that you should create a 1024x768 and an 800x600 image which you would then load depending on the screen resolution detected.
Havik
KendyChen
06-13-2003, 09:53 AM
i wanna kwon, please hlep!