Forum Moderators: not2easy
[webmasterworld.com...]
Look at rcjordan's msg 28.
And there's a discussion about it in this thread:
[webmasterworld.com...]
<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>
the image widths are not what mine would be these are just examples but i think this will do the job for now. Im still pretty green on css I dont know how to specify image sizes using css. I'll ask in that forum.
Specifying image sizes in css is straightforward, just define a class or ID and set the width to whatever you want:
.titlebar { width: 800px }
But css can't really do anything, it's simply something that is read and interpreted. You still have to use js to do something: either set the width directly as in the first script, tell the browser which style sheet to use as in the second script or some magic that one of the css gurus can come up with.