Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- handy, generic javascript coding


rcjordan - 2:10 am on Mar 13, 2002 (gmt 0)


Resize image based on resolution

<script type="text/javascript" language="JavaScript1.2">
<!--
var resWidth = window.screen.width;
if(resWidth > 1024) {
image1_width = 440;
}
else if(resWidth == 1024) {
image1_width = 380;
}
else if(resWidth == 800) {
image1_width = 320;
}
else if(resWidth < 800) {
image1_width = 260;
}
else {
image1_width = 260;
}
var image1 = '<img src="logo.gif" width="' + image1_width + '">';
document.write(image1);

// -->
</script>

[edited by: tedster at 2:40 am (utc) on May 31, 2011]


Thread source:: http://www.webmasterworld.com/javascript/567.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com