library Controls/sizeUtils
- getTextWidth
Модуль, в котором реализована функция getTextWidth(parent, child).
Высчитывает ширину переданного текста в пикселях.
Высчитывает по базовым на странице шрифту и размеру, то есть без довеска каких-либо классов.
- getWidth
Модуль, в котором реализована функция getWidth(element).
Высчитывает ширину переданного элемента в пикселях.
Методы
- getDimensions
Returns the size of an element and its position relative to the viewport. Should be used when the element may have display: contents, but you still want to get its real size and position.
The function makes certain assumptions about the element if it has display: contents:
1) The element is not a root element.
2) The children of the element have the same height.
3) The element doesn't have absolutely or stickily positioned children.