By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,626 Members | 1,929 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,626 IT Pros & Developers. It's quick & easy.

Variables

P: n/a
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>

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
mh********@adelphia.net wrote:
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

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.