DOM Element Width before Appended to DOM

后端 未结 6 1731
渐次进展
渐次进展 2020-12-09 02:27

I\'m sure the answer is no, but is it possible to determine the width of an element before it is appended to the DOM?

Once it\'s appended, I know I

6条回答
  •  渐次进展
    2020-12-09 03:11

    What you can do with MooTools is use the Element.Measure class - meaning, you inject the element to the DOM, but keep it hidden. Now, you can measure the element without actually showing it.

    http://mootools.net/docs/more/Element/Element.Measure

提交回复
热议问题