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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using of variables

Status
Not open for further replies.

VJar

Programmer
Aug 3, 2002
18
UA
In Java Script I define screen width and height and
depending on him some variables w and h become
the necessary values.
Is it possible in body of html document (not in script)
to use values of these variables for setting the sizes
of picture or other object? Variant with "document.write"
in Java script does'nt approach.
 
(in JavaScript)
I need to get screen width and height

If (screen.width==800)
{w=100;
h=100;} else
{w = 50
h=50}

(in body of html)
<img src=&quot;file:inage.jpg&quot; width= ?w? height=?h?>

?w?, ?h? - Is it impossible?
What can I make?
 

document.write(&quot;
<image src='img.gif' width=&quot; + w + &quot; height=&quot; + h + &quot; border='0' alt=''>
&quot;);

You cannot do this without javascript.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top