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 prop
string The CSS property.
value
string The value to set.
-
Enables tracking the position (propagating updates of the
bboxX
andbboxY
properties) 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 x
number The X position to test.
y
number The Y position to test.
w
number The width to test.
h
number The height to test.
recursive
bool 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 callback
function 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 f
function The function to run in frozen mode.
Type Definitions
-
A bounding box of an element on screen.
Properties:
Name Type Description x
number The X position.
y
number The Y position.
width
number The width.
height
number The height.
-
A keyboard event.
Properties:
Name Type Description accepted
bool Set to
true
if you handled the event in order to prevent it from bubbling up in the hierarchy of elements.original
KeyboardEvent The original HTML event.
key
string The name of the pressed key.
char
string The character of the pressed key.
altKey
bool Whether the Alt modifier is pressed.
ctrlKey
bool Whether the Ctrl modifier is pressed.
metaKey
bool Whether the Meta modifier is pressed.
shiftKey
bool Whether the Shift modifier is pressed.
location
number The location of the pressed key (see https://devdocs.io/dom/keyboardevent/location).
repeat
bool 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 event
html.Item.KeyboardEvent The event object.
-
Is triggered when a key is released while the item has keyboard focus.
Name Type Description event
html.Item.KeyboardEvent The event object.