开发者

Get div's size with mooTools

开发者 https://www.devze.com 2023-01-08 18:45 出处:网络
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/El

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

精彩评论

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