Variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mhawkins19@adelphia.net

    Variables

    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="javas cript">
    if (screen.width == 800)
    {topimg="002top _blue_r1_c1.gif "}
    if (screen.width == 1024)
    {topimg="02top_ blue_r1_c1.gif" }
    </SCRIPT>

  • Randy Webb

    #2
    Re: Variables

    mhawkins19@adel phia.net wrote:[color=blue]
    > 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="javas cript">
    > if (screen.width == 800)
    > {topimg="002top _blue_r1_c1.gif "}
    > if (screen.width == 1024)
    > {topimg="02top_ blue_r1_c1.gif" }
    > </SCRIPT>
    >[/color]

    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?



    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

    Comment

    Working...