Properties:
| Name | Type | Description |
|---|---|---|
ancestorsEnabled |
bool | [readonly] Whether all ancestors are enabled. |
ancestorsVisible |
bool | [readonly] Whether all ancestors are visible. |
aspectRatio |
number | (default: |
bbox |
html.Item.BoundingBox | [readonly] The item's bounding box in window coordinates. |
bboxX |
number | [readonly] The item's bounding box X position in window coordinates. Reading this gives the current value, but updates aren't propagated automatically. |
bboxY |
number | [readonly] The item's bounding box Y position in window coordinates. Reading this gives the current value, but updates aren't propagated automatically. |
bboxWidth |
number | [readonly] The item's bounding box width in window coordinates. |
bboxHeight |
number | [readonly] The item's bounding box height in window coordinates. |
canFocus |
bool | (default: |
contentHeight |
number | [readonly] The current scrolling viewport height. |
contentWidth |
number | [readonly] The current scrolling viewport width. |
contentX |
number | (default: |
contentY |
number | (default: |
cursor |
string | The mouse cursor shape over the item. Accepts CSS cursor names. |
enabled |
bool | (default: |
fillHeight |
bool | (default: |
fillWidth |
bool | (default: |
fill |
bool | [writeonly] Shortcut property for setting |
focus |
bool | (default: |
height |
number | (default: |
marginBottom |
number | (default: |
marginLeft |
number | (default: |
marginRight |
number | (default: |
marginTop |
number | (default: |
margins |
number | [writeonly] Shortcut property for setting |
maxHeight |
number | (default: |
maxWidth |
number | (default: |
minHeight |
number | (default: |
minWidth |
number | (default: |
opacity |
number | (default: |
order |
number | (default: |
origin |
string | (default: |
perspective |
number | (default: |
position |
string | (default: |
rotationAngle |
number | (default: |
rotationAxis |
vec3 | (default: |
ruler |
html.Ruler | (default: |
scrolling |
bool | [readonly] Whether the item is currently scrolling. |
style |
Array.<string> | (default: |
trapFocus |
bool | (default: |
visible |
bool | (default: |
width |
number | (default: |
x |
number | (default: |
y |
number | (default: |
Extends
Methods
-
Applies a CSS property to this item's HTML element. This method makes use of caching in order to minimize the number of actual operations on the DOM. Do not use CSS shortcuts, such as
margin, with this method.Name Type Description propstring The CSS property.
valuestring The value to set.
-
Enables tracking the position (propagating updates of the
bboxXandbboxYproperties) of this element. This is disabled by default for performance reasons, but, if needed, can be enabled by calling this method.Calling this method multiple times has no further effect.
-
Returns the item's DOM element. Subclasses must override this abstract method.
Returns:
Type Description HTMLElement The DOM element. -
Returns whether the given box is (partially) within the viewport. The coordinates are in this element's local coordinate system.
Name Type Description xnumber The X position to test.
ynumber The Y position to test.
wnumber The width to test.
hnumber The height to test.
recursivebool If
true, this method is called recursively to return whether the box is (partially) visible at all. -
Invokes the given callback on the next render frame.
Name Type Description callbackfunction The callback to invoke.
-
Updates the CSS properties to position and size the item.
-
Runs the given function without doing the rather expensive sizing calculations inbetween. Sizing calculations are frozen globally, not only for this item, during the function.
Name Type Description ffunction The function to run in frozen mode.
Type Definitions
-
A bounding box of an element on screen.
Properties:
Name Type Description xnumber The X position.
ynumber The Y position.
widthnumber The width.
heightnumber The height.
-
A keyboard event.
Properties:
Name Type Description acceptedbool Set to
trueif you handled the event in order to prevent it from bubbling up in the hierarchy of elements.originalKeyboardEvent The original HTML event.
keystring The name of the pressed key.
charstring The character of the pressed key.
altKeybool Whether the Alt modifier is pressed.
ctrlKeybool Whether the Ctrl modifier is pressed.
metaKeybool Whether the Meta modifier is pressed.
shiftKeybool Whether the Shift modifier is pressed.
locationnumber The location of the pressed key (see https://devdocs.io/dom/keyboardevent/location).
repeatbool Whether the key event was triggered by auto-repeat of an already pressed key.
Events
-
Is triggered when a key is pressed while the item has keyboard focus.
Name Type Description eventhtml.Item.KeyboardEvent The event object.
-
Is triggered when a key is released while the item has keyboard focus.
Name Type Description eventhtml.Item.KeyboardEvent The event object.