clipLeft
Property of css/cssom/propertiescss/cssom/properties
Syntax
var result = element.clipLeft;
element.clipLeft = value;
Examples
This example demonstrates how to read the clipLeft property from the currentStyle object of an image.
<SCRIPT>
function setClip(sOptionValue) {
oImage.style.clip="rect(0,100,100,"+sOptionValue+")";
if (oImage.currentStyle.clipLeft == "60px") {
alert("The image has been clipped to 60px.");
}
:
}
</SCRIPT>
:
<IMG ID=oImage SRC="/workshop/graphics/sphere.png">
:
Pick an amount to clip the left:
// 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>
Syntax
See also
Related articles
CSSOM
clipLeft
Related pages
- CSSStyleDeclarationCSSStyleDeclaration
- currentStylecurrentStyle
- stylestyle
Reference
- clipclip
- clipBottomclipBottom
- clipRightclipRight
- clipTopclipTop
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]