jQuery获取或设置元素的宽度和高度
生活随笔
收集整理的這篇文章主要介紹了
jQuery获取或设置元素的宽度和高度
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
jQuery獲取或設(shè)置元素的寬度和高度: 可使用以下3種方法: 1,jQuery width() 和 height() 方法; 2,innerWidth() 和 innerHeight() 方法; 3,outerWidth() 和 outerHeight()方法。 jQuery width() 和 height() 方法,innerWidth() 和 innerHeight() 方法,outerWidth() 和 outerHeight() 方法的區(qū)別如下: 一、jQuery width() 和 height() 方法
width() 方法設(shè)置或返回元素的寬度(不包括內(nèi)邊距、邊框或外邊距)。
height() 方法設(shè)置或返回元素的高度(不包括內(nèi)邊距、邊框或外邊距)。 二、jQuery innerWidth() 和 innerHeight() 方法
innerWidth() 方法設(shè)置或返回元素的寬度(包括內(nèi)邊距)。
innerHeight() 方法設(shè)置或返回元素的高度(包括內(nèi)邊距)。 三、jQuery outerWidth() 和 outerHeight() 方法
outerWidth() 方法設(shè)置或返回元素的寬度(包括內(nèi)邊距和邊框)。
outerHeight() 方法設(shè)置或返回元素的高度(包括內(nèi)邊距和邊框)。
width() 方法設(shè)置或返回元素的寬度(不包括內(nèi)邊距、邊框或外邊距)。
height() 方法設(shè)置或返回元素的高度(不包括內(nèi)邊距、邊框或外邊距)。 二、jQuery innerWidth() 和 innerHeight() 方法
innerWidth() 方法設(shè)置或返回元素的寬度(包括內(nèi)邊距)。
innerHeight() 方法設(shè)置或返回元素的高度(包括內(nèi)邊距)。 三、jQuery outerWidth() 和 outerHeight() 方法
outerWidth() 方法設(shè)置或返回元素的寬度(包括內(nèi)邊距和邊框)。
outerHeight() 方法設(shè)置或返回元素的高度(包括內(nèi)邊距和邊框)。
轉(zhuǎn)載于:https://www.cnblogs.com/cqj98k/p/10038765.html
總結(jié)
以上是生活随笔為你收集整理的jQuery获取或设置元素的宽度和高度的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 测试我自己的系统是大端还是小端
- 下一篇: zoj-4011(动态规划)