DHTML Object Properties DHTML Objects
Retrieves the left coordinate of the object clipping region.
HTML |
N/A |
Script |
[ sLeft = ] currentStyle.clipLeft |
auto |
Clip to expose the entire object. |
sTop |
Length value, which may have a units designator ( px, pt, em, cm, mm, or in ) appended. |
The property is read-only with no default value.
Setting the value to auto exposes the left side, meaning the side is not clipped.
The following example demonstrates reading the clipLeft property off the currentStyle object of a image.
<script language="JavaScript">
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.jpg">
:
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>
This feature requires Microsoft® Internet Explorer® 4.0 or later.
Show me
clip, clipRight, clipTop, clipBottom