---
title: "Helpers/size"
---
# Helpers/size

### getContentWidth()

**getContentWidth**(`element`, `win`): `number`

Defined in: [src/core/helpers/size/get-content-width.ts:11](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/get-content-width.ts#L11)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `element` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) |
| `win` | [`Window`](https://developer.mozilla.org/docs/Web/API/Window) |

#### Returns

`number`

***

### getFixedPositionOffset()

**getFixedPositionOffset**(`elm`): [`IPoint`](../interfaces/types.IPoint.html)

Defined in: [src/core/helpers/size/get-fixed-position-offset.ts:44](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/get-fixed-position-offset.ts#L44)

Returns the viewport offset of the containing block of a `position: fixed`
descendant of `elm`. A fixed element is normally positioned relative to the
viewport, but an ancestor with `transform`, `filter`, `perspective`, etc.
establishes a new containing block, shifting the fixed element by that
ancestor's top-left corner. The returned offset should be subtracted from
the desired viewport coordinates before applying them.

Returns `{ x: 0, y: 0 }` when no such ancestor exists (the common case), so
call sites keep their previous behaviour unchanged.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `elm` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) |

#### Returns

[`IPoint`](../interfaces/types.IPoint.html)

***

### getScrollParent()

**getScrollParent**(`node`): [`Nullable`](./types.html#nullable)\<[`Element`](https://developer.mozilla.org/docs/Web/API/Element)\>

Defined in: [src/core/helpers/size/get-scroll-parent.ts:16](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/get-scroll-parent.ts#L16)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `node` | [`Nullable`](./types.html#nullable)\<[`Node`](https://developer.mozilla.org/docs/Web/API/Node)\> |

#### Returns

[`Nullable`](./types.html#nullable)\<[`Element`](https://developer.mozilla.org/docs/Web/API/Element)\>

***

### innerWidth()

**innerWidth**(`element`, `win`): `number`

Defined in: [src/core/helpers/size/inner-width.ts:11](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/inner-width.ts#L11)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `element` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) |
| `win` | [`Window`](https://developer.mozilla.org/docs/Web/API/Window) |

#### Returns

`number`

***

### size()

**size**(`subject`): `number`

Defined in: [src/core/helpers/size/object-size.ts:14](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/object-size.ts#L14)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `subject` | [`CanUndef`](./types.html#canundef)\<`string` \| `object` \| `unknown`[]\> |

#### Returns

`number`

***

### offset()

**offset**(`elm`, `jodit`, `doc`, `recurse?`): [`IBound`](../interfaces/types.IBound.html)

Defined in: [src/core/helpers/size/offset.ts:18](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/offset.ts#L18)

#### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `elm` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) \| [`Range`](https://developer.mozilla.org/docs/Web/API/Range) | `undefined` |
| `jodit` | [`IViewBased`](../interfaces/types.IViewBased.html) | `undefined` |
| `doc` | [`Document`](https://developer.mozilla.org/docs/Web/API/Document) | `undefined` |
| `recurse` | `boolean` | `false` |

#### Returns

[`IBound`](../interfaces/types.IBound.html)

***

### position()

Calculate screen element position

#### Call Signature

**position**(`elm`): [`IBound`](../interfaces/types.IBound.html)

Defined in: [src/core/helpers/size/position.ts:14](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/position.ts#L14)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `elm` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) |

##### Returns

[`IBound`](../interfaces/types.IBound.html)

#### Call Signature

**position**(`elm`, `jodit`): [`IBound`](../interfaces/types.IBound.html)

Defined in: [src/core/helpers/size/position.ts:15](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/position.ts#L15)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `elm` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) |
| `jodit` | [`IViewBased`](../interfaces/types.IViewBased.html) |

##### Returns

[`IBound`](../interfaces/types.IBound.html)

#### Call Signature

**position**(`elm`, `jodit`, `recurse`): [`IBound`](../interfaces/types.IBound.html)

Defined in: [src/core/helpers/size/position.ts:16](https://github.com/xdan/jodit/blob/main/src/core/helpers/size/position.ts#L16)

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `elm` | [`HTMLElement`](https://developer.mozilla.org/docs/Web/API/HTMLElement) |
| `jodit` | [`IViewBased`](../interfaces/types.IViewBased.html) |
| `recurse` | `boolean` |

##### Returns

[`IBound`](../interfaces/types.IBound.html)
