Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

clipTop property

Gets the top coordinate of the object clipping region.

This property is read-only.

Syntax

JavaScript

p = object.clipTop

Property values

Type: Variant

auto

The top side of object is fully exposed—that is, the top side is not clipped.

length

Floating-point number, followed by a supported length unit.

Examples

This example demonstrates how to read the clipTop property from the currentStyle object of an image.


<script type="text/javascript">
function setClip(sOptionValue) {
  oImage.style.clip="rect("+sOptionValue+",100,100,0)";
  if (oImage.currentStyle.clipTop == "60px") {
    console.log("The image has been clipped to 60px.");
  }
...
}	 
</script>
... 
<img id="oImage" alt="sphere" src="/workshop/graphics/sphere.png"> 
... 
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>


See also

CSSStyleDeclaration
currentStyle
style
Reference
clip
clipBottom
clipLeft
clipRight

 

 

Show:
© 2014 Microsoft