Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rating: Thread Rating: 2 votes, 4.00 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-22-2007, 03:48 PM   PM User | #1
voxecho
New Coder

 
Join Date: Jan 2006
Location: South Central, KS
Posts: 81
Thanks: 2
Thanked 2 Times in 2 Posts
voxecho is an unknown quantity at this point
getting ACTUAL width of a select box

is there any way to find out what the "physical" width of a select is. o.style.width only returns the value set with css, i would like to know what width occures when you don't set a style (ie. allow the browser to size based on content)

is this possible?
voxecho is offline   Reply With Quote
Old 03-22-2007, 11:18 PM   PM User | #2
shyam
Senior Coder

 
shyam's Avatar
 
Join Date: Jul 2005
Posts: 1,563
Thanks: 2
Thanked 163 Times in 160 Posts
shyam will become famous soon enough
Code:
o.style.offsetWidth

Last edited by Kor; 03-23-2007 at 08:06 AM.. Reason: WRONG! offset attributes are not CSS. object.offsetWidth is the answer
shyam is offline   Reply With Quote
Old 03-22-2007, 11:32 PM   PM User | #3
david_kw
Senior Coder

 
Join Date: Nov 2006
Posts: 1,000
Thanks: 0
Thanked 0 Times in 0 Posts
david_kw will become famous soon enough
I think it might be outside the style object like

o.offsetWidth

although I've never used it myself. It could be browser dependent too I suppose.

david_kw
david_kw is offline   Reply With Quote
Old 03-26-2007, 06:50 PM   PM User | #4
shyam
Senior Coder

 
shyam's Avatar
 
Join Date: Jul 2005
Posts: 1,563
Thanks: 2
Thanked 163 Times in 160 Posts
shyam will become famous soon enough
Kor is right offsetWidth isn't a style attribute.. (Thanks for catching that Kor )...offsetWidth is supported by both IE and mozilla http://www.quirksmode.org/dom/getstyles.html
shyam is offline   Reply With Quote
Old 06-15-2007, 05:30 PM   PM User | #5
voxecho
New Coder

 
Join Date: Jan 2006
Location: South Central, KS
Posts: 81
Thanks: 2
Thanked 2 Times in 2 Posts
voxecho is an unknown quantity at this point
i forgot to answer this...

thanks all, it worked out fine :-D
voxecho is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:25 PM.


Advertisement
Log in to turn off these ads.