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.
.getComputedStyle("width")
.get('offsetWidth')
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.
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.