JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old February 13th, 2005, 09:58 PM
delpi767 delpi767 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 2 delpi767 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 41 sec
Reputation Power: 0
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-

Reply With Quote
  #2  
Old February 14th, 2005, 08:23 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
What happens when you try:
document.getElementById("sofmenu").style.left = '100px'
document.getElementById("sofmenu").style.visibility = 'visible'

Reply With Quote
  #3  
Old February 14th, 2005, 10:41 AM
delpi767 delpi767 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 2 delpi767 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 41 sec
Reputation Power: 0
Quote:
Originally Posted by MadCowDzz
What happens when you try:
document.getElementById("sofmenu").style.left = '100px'
document.getElementById("sofmenu").style.visibility = 'visible'


It works just fine. Thanks.

It would have taken me 100 years to think to append "px" to the end of the value.

-Mac-

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > programattically changing position of object


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway