Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
yui3 の要素の幅 (ピクセル単位) をどのように計算しますか? おそらくdivにCSS幅が設定されていないため、正しい結果が返されませんでした.getComputedStyle("width")。.get('offsetWidth')
.getComputedStyle("width")
.get('offsetWidth')
ここではうまく機能していますが、失敗した例を教えてください。
おそらく、パディング/ボーダーが含まれることを期待していますか? JQuery の .width() にもそれらは含まれていませんが、おそらくそれが混乱の原因です。