tags:

views:

97

answers:

1

I have a div with a width of 200px. There is text inside that is set not to wrap. So there is overflow. I need to get the width of the content of the div including the overflow.

I am using this for a YUI autocomplete dropdown menu. I want the dropdown to grow horizontally if the width of a result is greater than the width of the div.

How can I get the width of the content (not the css width, so offsetWidth doesn't work) including the overflow?

A: 

Use scrollWidth / scrollHeight properties.

SleepyCod