A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/css/cssom/properties/clipTop below:

clipTop ยท WebPlatform Docs

clipTop

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

Syntax
var result = declaration.clipTop;
declaration.clipTop = value;
Return Value

Returns an object of type StringString

Examples

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

<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>

View live example

Syntax See also Related articles CSSOM Related pages Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4