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

adding value to id - style.top

Status
Not open for further replies.

avivit

Technical User
Jul 5, 2000
456
IL
What do I do wrong here?
It's regarding NS6:
document.getElementById(idName).style.top += move;

"move" is a variable.It has the right value,
and so has the "document.getElementById(idName).style.top "
But there's an error in the way I'm trying to add "move" value to the style.top.
How do I assign value here?
Thanks

 
does it give you an error? to maintain consistency with standards, be sure to add "px" to the end of any numerical style definition... jared@aauser.com
 
Thanks jaredn.
The probelm DID occur due to "px" units probelm,
only I had to take the "px" units off and than
add the values.
The reason for it is that in ns6:
document.getElementById(idName).style.top" contains units string too (example: "120px" and not just "120").
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top