当前位置: 移动技术网 > IT编程>开发语言>Jquery > jQuery获取或设置元素的宽度和高度

jQuery获取或设置元素的宽度和高度

2018年11月30日  | 移动技术网IT编程  | 我要评论
jquery获取或设置元素的宽度和高度:
可使用以下3种方法:
1,jquery width() 和 height() 方法;
2,innerwidth() 和 innerheight() 方法;
3,outerwidth() 和 outerheight()方法。
 
jquery width() 和 height() 方法,innerwidth() 和 innerheight() 方法,outerwidth() 和 outerheight() 方法的区别如下:
一、jquery width() 和 height() 方法
width() 方法设置或返回元素的宽度(不包括内边距、边框或外边距)。
height() 方法设置或返回元素的高度(不包括内边距、边框或外边距)。
 
二、jquery innerwidth() 和 innerheight() 方法
innerwidth() 方法设置或返回元素的宽度(包括内边距)。
innerheight() 方法设置或返回元素的高度(包括内边距)。
 
三、jquery outerwidth() 和 outerheight() 方法
outerwidth() 方法设置或返回元素的宽度(包括内边距和边框)。
outerheight() 方法设置或返回元素的高度(包括内边距和边框)。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网