asp.net.ph

Skip Navigation Links

clipTop Property

DHTML Object Properties   DHTML Objects


Retrieves the top coordinate of the object clipping region.

Syntax

HTML N/A
Script [ sTop = ] currentStyle.clipTop

Possible Values

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.

Remarks

Setting the value to auto exposes the top side, meaning the side is not clipped.

Example

The following example demonstrates reading the clipTop property off the currentStyle object of an image.

<script language="JavaScript">
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.jpg">
:
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>

 Show me 

See Also

clip, clipBottom, clipLeft, clipRight


Need a break ?
Suggested Reading

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

If you have any question, comment or suggestion,
please send us a note