yui3's version of jquery's .width()

855 Views Asked by At

How do you calculate the width (in pixels) of an element in yui3? I have tried .getComputedStyle("width") and .get('offsetWidth') and neither return the correct results, possibly because the div doesn't have a CSS width set on it.

1

There are 1 best solutions below

0
On

It's working fine for me here, could you provide an example where it fails?

Maybe you're expecting it to include padding/border? JQuery's .width() doesn't include those either, but perhaps that's where the confusion lies.