Creating a Container
Properties
children
List of Container’s child elements
Padding
Left padding in pixels
Right padding in pixels
Top padding in pixels
Bottom padding in pixels
Layout and Background
A method to layout children
Background element
Masking
An element to use as a container’s mask (clipping region)
If set to
true all content going outside the bounds of the container will be clippedInteractivity
If set to
true all descendants will become “interactive”States
If set to
true, applying a state on a container will also apply the same state on its childrenScrolling
Setting this to an instance of Scrollbar will enable vertical scrolling of content if it does not fit into the Container
Other
If set to
true its children will be laid out in opposite orderHTML content of the container
Methods
innerWidth()
Returns container’s inner width (width without padding) in pixels.Inner width in pixels
innerHeight()
Returns container’s inner height (height without padding) in pixels.Inner height in pixels
contentWidth()
Returns width of the container’s content in pixels.Content width in pixels
contentHeight()
Returns height of the container’s content in pixels.Content height in pixels
walkChildren()
Executes a callback function for each child element recursively.Function to execute for each child
eachChildren()
Executes a callback function for each direct child.Function to execute for each child
allChildren()
Returns an array of all children including background, scrollbar, and mask.Array of all children
scrollToChild()
If scrolling is enabled on the Container, scrolls in such way that target element becomes visible.Target child element