clipTop property (Internet Explorer)

Switch View :
ScriptFree
clipTop property

Gets the top coordinate of the object clipping region.

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

A floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc), or a relative units designator (em, ex, or px). For more information about the supported length units, see CSS Length Units.

Examples

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

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/clipTop.htm


<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.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
CSSCurrentStyleDeclaration Constructor
Reference
clip
clipBottom
clipLeft
clipRight

 

 

Send comments about this topic to Microsoft

Build date: 3/14/2012