width()


version 1.0 以降

解説

最初にマッチした要素の、現在の横幅を計算し、ピクセル単位で返します。

概念図

jquery dimensions height

戻り値

  • 現在の要素の横幅 (ピクセル)

関連


テーブルの最後の列を除去し、横幅を表示します。

$("#test_result td:last-child").remove();    // テーブルの最後の列を除去

alert($("#test_result table").width() + " pixel");

1jQueryhttp://jquery.com/
2prototype.jshttp://www.prototypejs.org/
3Exthttp://extjs.com/
4script.aculo.ushttp://script.aculo.us/
5YUIhttp://developer.yahoo.com/yui/