开发者

Get div's size with mooTools

I have some <div id="text">abc</div>. Is it possible to get it's size using JS/mooTools (width and height) when I did 开发者_运维技巧not set it with CSS ?


http://mootools.net/docs/core/Element/Element.Dimensions#Element:getSize

var size = myElement.getSize();
[size.x, size.y]


$('myElement').getStyle('width'); 

returns the width of that element.

$('myElement').setStyle('width', 'value');

u can change it

thats all :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜