|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
programattically changing position of object
given
<style> #sofmenu { position: absolute; left: 325px; top: 27px; color : navy; width : 100; background-color : silver; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 12px; padding : 6px 6px 6px 6px; border : 1px 1px 1 px 1px; border-style : solid; z-index : 10; line-height : 20px; visibility : hidden; } </style> <span id = "sofmenu"> Ms Office<br> Winzip<br> Belarc Advisor<br> Delphi<br> </span> How do I change the "left" position of "sofmenu" before I set its visibility to "visible"? I've tried document.all ['sofmenu'].style.left = xxx; document.all ['sofmenu'].style.visibility = 'visible'; The visibility changes but the left position does not. I've also tried q = document.getElementById ("sofmenu"); q.offSetLeft == XXX; With no success. Thanks, -Mac- |
|
#2
|
||||
|
||||
|
What happens when you try:
document.getElementById("sofmenu").style.left = '100px' document.getElementById("sofmenu").style.visibility = 'visible' |
|
#3
|
|||
|
|||
|
Quote:
It works just fine. Thanks. It would have taken me 100 years to think to append "px" to the end of the value. -Mac- |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > programattically changing position of object |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|