Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Retrieves the top coordinate of the object clipping region.
Syntax
HTML N/A Scripting [ sTop = ] currentStyle.clipTop
Possible Values
The property is read-only with no default value.
auto Clip to expose the entire object. sTop Length value, which may have a units designator (px, pt, em, cm, mm, or in) appended.
Remarks
Setting the value to auto exposes the top side, meaning the side is not clipped.
Example
The following example demonstrates reading the clipTop property off the currentStyle object of an image.
Sample Code
<SCRIPT> function setClip(sOptionValue) { oImage.style.clip="rect("+sOptionValue+",100,100,0)"; if (oImage.currentStyle.clipTop == "60px") { alert("The image has been clipped to 60px."); } : } </SCRIPT> : <IMG ID=oImage SRC="/workshop/graphics/sphere.jpg"> : Pick an amount to clip the top: // the option value is sent as an argument: <SELECT onchange="setClip(value)"> <OPTION VALUE=100>reset </OPTION> <OPTION VALUE=40>40px </OPTION> <OPTION VALUE=50>50px </OPTION> <OPTION VALUE=60>60px </OPTION> </SELECT>
Applies To
See Also
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.