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

Operators

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