Click to See Complete Forum and Search --> : Automatically resize image depending on resolution
sanjuT
06-10-2004, 10:01 AM
I have an include file that contains images.
how can i have it so that the images appear relatively the same size on the screen in both 800x600 and 1024 resolutions?
looks fine in 1024, too big in 800x600.
thanks!
Will this work (taken from JavaScriptSource.com)?
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Original: Daniel Farmer (danfarmer@hotmail.com) -->
<!-- Web Site: http://www.mp3.com/protoculture -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
if (screen.height >= 768 && screen.width >= 1024) {
document.write("<img src='http://your-web-site-address-here.com/image.gif' width=850 height=11 border=0>");
}
else {
if (screen.height == 600 && screen.width == 800) {
document.write("<img src='http://your-web-site-address-here.com/image.gif' width=600 height=11 border=0>");
}
else {
document.write("<img src='http://your-web-site-address-here.com/image.gif' width=475 height=11 border=0>");
}
}
// End -->
</script>