Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

detect screen size & then change imgs to bigger or smaller imgs

Status
Not open for further replies.

leeolive

Programmer
May 14, 2002
46
GB
Hi

I am using a script to detect screen sizes. If the screen is 600/800/1024, I use a specific ext style sheet to tailor the fonts etc for that screen size.

My question is:
I have a page 'index.html' with 7 images.
I want to be able to change these images so that if the screen size is 600 I use/load/specify smaller images, if it is 1024 I use larger images.

Does anyone know how I can do this? Do you have to give each img on the index.html page a specific ID and then refer to that id?

...not seeing the whole picture here.. is this possible and how?


thanks!
Lee
 
Here is how you can find out peoples screen resolutions, but I don't know how you can do the rest of what you want to do:

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function display()
{
document.form.width.value = window.screen.width;
document.form.height.value = window.screen.height;
}
</script>

<body OnLoad=&quot;display()&quot;>

<form name=form>
<B>RESOLUTION:
<input type=text size=4 maxlength=4 name=width readOnly> x</B> <input type=text size=4 maxlength=4 name=height readOnly></form>

Hope this helps!





colorado.gif

&quot;Quest for the Cup - 2002!&quot;
&quot;Onto the 2nd round!&quot;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top