开发者

Image width on Safari with Prototype

开发者 https://www.devze.com 2023-04-01 14:16 出处:网络
I am working with javascript and i want to get an image width with prototype. I did : lastElement.down(\'img\').width

I am working with javascript and i want to get an image width with prototype. I did :

 lastElement.down('img').width

It working on firefox but Safari ruturn 0. An开发者_开发知识库yone can help me?


lastElement.down('img').getWidth()

If you just access someimg.width what you're getting is the width attribute on the img-tag itself, which may not be set.

See Prototype's docs for more

0

精彩评论

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