CssRect class

A class for representing CSS dimensions.

A class for representing CSS dimensions.

In contrast to the more general purpose Rectangle class, this class's values are mutable, so one can change the height of an element programmatically.

Important note: use of these methods will perform CSS calculations that can trigger a browser reflow. Therefore, use of these properties during an animation frame is discouraged. See also: Browser Reflow

Extends:

Constructors

CssRect ( Element _element )

Instance Properties

left num
read-only
top num
read-only
height num
read/write
width num
read/write
hashCode int Inherited
read-only
read-only
bottom num Inherited
read-only
topLeft Point<num> Inherited
read-only
topRight Point<num> Inherited
read-only
bottomRight Point<num> Inherited
read-only
bottomLeft Point<num> Inherited
read-only
left num Inherited
read/write
The x-coordinate of the left edge.
top num Inherited
read/write
The y-coordinate of the left edge.
width num Inherited
read/write
height num Inherited
read/write
bottomLeft Point<num> Inherited
read-only
height num Inherited
read/write
bottomRight Point<num> Inherited
read-only
top num Inherited
read/write
The y-coordinate of the left edge.
bottom num Inherited
read-only
topRight Point<num> Inherited
read-only
left num Inherited
read/write
The x-coordinate of the left edge.
read-only
width num Inherited
read/write
topLeft Point<num> Inherited
read-only

Instance Methods

toString Inherited ( ) → String
Returns a string representation of this object.
intersection Inherited ( Rectangle<num> other ) → Rectangle<num>
Computes the intersection of this and other.
intersects Inherited ( Rectangle<num> other ) → bool
Returns true if this intersects other.
boundingBox Inherited ( Rectangle<num> other ) → Rectangle<num>
Returns a new rectangle which completely contains this and other.
containsRectangle Inherited ( Rectangle<num> another ) → bool
Tests whether this entirely contains another.
containsPoint Inherited ( Point<num> another ) → bool
Tests whether another is inside or along the edges of this.
boundingBox Inherited ( Rectangle<num> other ) → Rectangle<num>
Returns a new rectangle which completely contains this and other.
intersection Inherited ( Rectangle<num> other ) → Rectangle<num>
Computes the intersection of this and other.

Operators

operator == Inherited ( other ) → bool
The equality operator.