Retrieves the top coordinate of the object clipping region.
Syntax
HTML N/A Scripting [ sTop = ] currentStyle.clipTop
Possible Values
sTop String that specifies one of the following values:
auto Top side of object is fully exposedthat is, the top side is not clipped. length Floating-point number, followed by an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex). For more information about the supported length units, see CSS Length Units. The property is read-only with no default value.
Example
This example demonstrates how to read the clipTop property from 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
currentStyle
See Also