Variables

M

mhawkins19

Quick question.

I am fighting with desiging a website that will stretch the top image
to accomodate for different screen resolutions.

What I would like to do is check the screen size and then based upon
that use one image or another for a td (table column) background.

I can read the screen size and stope my image name into a variable but
how do I read that variable later on in my html code? Is this possible?

Any insight would be appreciated.

So far I have...

<SCRIPT LANGUAGE="javascript">
if (screen.width == 800)
{topimg="002top_blue_r1_c1.gif"}
if (screen.width == 1024)
{topimg="02top_blue_r1_c1.gif"}
</SCRIPT>
 
R

Randy Webb

Quick question.

I am fighting with desiging a website that will stretch the top image
to accomodate for different screen resolutions.

What I would like to do is check the screen size and then based upon
that use one image or another for a td (table column) background.

I can read the screen size and stope my image name into a variable but
how do I read that variable later on in my html code? Is this possible?

Any insight would be appreciated.

So far I have...

<SCRIPT LANGUAGE="javascript">
if (screen.width == 800)
{topimg="002top_blue_r1_c1.gif"}
if (screen.width == 1024)
{topimg="02top_blue_r1_c1.gif"}
</SCRIPT>

You can stop right there because you will fail ultimately. What if my
monitor is set to 1024 wide but my browser is only 800 pixels wide?

http://allmyfaqs.com/faq.pl?AnySizeDesign
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top