jquery height和outerHeight width和outerWidth 區別

$(‘element’).width();     獲取:元素本身寬度

$(‘element’).outerWidth();     獲取:元素的寬度+padding寬度+border寬度

$(‘element’).outerWidth(true);    獲取:元素的寬度+padding寬度+border寬度+margin的寬度

 

$(‘element’).height();     獲取:元素本身高度

$(‘element’).outerHeight();     獲取:元素的高度+padding高度+border高度

$(‘element’).outerHeight(true);    獲取:元素的高度+padding高度+border高度+margin的高度

轉載於 :  Witty Blog

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章