This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

clipRight

Property of css/cssom/CSSStyleDeclaration/CSSStyleDeclarationcss/cssom/CSSStyleDeclaration/CSSStyleDeclaration

Syntax

var result = declaration.clipRight;
declaration.clipRight = value;

Return Value

Returns an object of type StringString

Examples

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

<SCRIPT>
function setClip(sOptionValue) {
    oImage.style.clip="rect(0,"+sOptionValue+",100,0)";
    if (oElmnt1.currentStyle.clipRight == "60px") {
        alert("The image has been clipped to 60px.");
        }
:
}
</SCRIPT>
:
<IMG ID=oImage SRC="/workshop/graphics/sphere.png">
:
Pick an amount to clip the right:
    // 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>

View live example

Syntax

See also

Related articles

CSSOM

Related pages

Attributions