Determine whether element has fixed or percentage width using JavaScript

前端 未结 5 428
情话喂你
情话喂你 2020-12-18 08:24

Using Mootools Element.Dimensions I can get the computed size, in pixels, of any element. However, I can find no way of telling whether an element has been sized using pixel

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 08:38

    In IE, element.currentStyle.width. In many other browsers, getComputedStyle(element, null).getPropertyValue('width').

提交回复
热议问题