'clipBottom' Example : Clip « Style Layout « JavaScript DHTML






'clipBottom' Example


<html>
<head>
<style>
#myImage {position:absolute; 
      top:224px; 
      left:75px; 
      clip:rect(0,300,225,0)}
</style>
<script language="JavaScript">
    function function1() {
        document.all.myImage.style.clip = "rect(0,300,225,0)"
    } 
    function function2() {
        document.all.myImage.style.clip = "rect(0,300, 50,0)";
    } 
</script>
</head>
<body bgcolor="#EEEEEE" bottommargin="100"> 
<img src="http://www.java2s.com/style/logo.png" id="myImage">
<input type="button" value="Restore" onClick="function1();">
<input type="button" value="Clip bottom 50" onClick="function2(50);">
</body>
</html>
    
      
      








Related examples in the same category

1.'clipLeft' Example
2.'clipTop' Example
3.'clipRight' Example