jQuery CSS操作:height()方法: 返回或设置匹配元素的高度

返回第一个匹配元素的高度(像素数)

$(selector).height();

设置所有匹配元素的高度(像素数

$(selector).height(50);

使用函数设置所有匹配元素高度(像素数

$(selector).height( function(index, oldheight) )

function(index, oldheight):返回被选元素新像素数的函数。

index:可选。选择器的index(从0开始

oldvalue:可选。选择器的当前选择元素的像素数

详情

posted @ 2016-05-18 10:37  Carolina  阅读(695)  评论(0编辑  收藏  举报