July 9, 2000 - HTC-Master Focus/Blur Events
July 9, 2000 HTC-Master Focus/Blur Events Tips: July 2000
Yehuda Shiran, Ph.D.
|
STYLE
before you can set or modify it during a script. Suppose you have the following
DIV
element:
<DIV ID="oSun"><IMG SRC="planet.gif"></DIV>
And at some point during your
script you want to set the position of the above DIV
element. You would probably write something like:
oSun.style.left = 50;
oSun.style.top = 70;
You try to run it and nothing
comes up on the screen. The reason? The STYLE
tag has not been defined for the above DIV
element. Defining the STYLE
is straightforward:
<STYLE>
.block {position: absolute; top: 100; left: 100}
</STYLE>
Once the style parameters are predefined, you can modify them via the script, as shown above.