Positionable objects can have a clipping region defined for them. This defines the area of the styled object that is visible. At present you can only clip to a rectangular shape. You can specify either a clipping region measured in pixels, or use the symbolic name "auto" to use the extent rectangle surrounding the object as its clip region. The coordinates should be specified in the order: top, right, bottom and left and need to be enclosed in a rect() constructor function to instantiate a rect object to be assigned to the property.
You should be careful not to exceed the extent rectangle of the containing parent element. This should not cause a problem and the clipping regions should be clipped one within the other, but MSIE does not handle this very gracefully sometimes.
If you access the left, right, top and bottom properties of the style.clip rect object individually, you can specify a single numeric value for each as need be.
See also: | Clip object, Rect object |
Prev | Home | Next |
style.clear | Up | style.clip.bottom |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |