ホーム >>> HTML整理ノート

文字列のclip(切り取り).

CSS STYLE

 

 

 



Sample Source......................................................................>>>

<script language="JavaScript"><!--
function Clip(n){
 if(n == 1)dv.style.clip = "rect(30 370 60 0)";
 else if(n == 2)dv.style.clip = "rect(0 300 100 60)";
 else if(n == 3)dv.style.clip = "rect(40 370 100 0)";
 else if(n == 4)dv.style.clip = "rect(0 370 40 0)";
 else if(n == 5)dv.style.clip = "rect(0 370 100 180)";
 else if(n == 6)dv.style.clip = "rect(0 180 100 0)";
 else dv.style.clip = "rect(0 370 100 0)";
}
//--></script>
</head>

<div id="dv" style="position:absolute;top:140;left:280;color:navy;
   font:bold 100px 'Arial Black';width:370px;border:thin solid magenta">
 <p>CSS STYLE</p>
</div>
<p>
 <button onclick="Clip(0);"> クリップを止める</button> 
 <button onclick="Clip(1);">上下をクリップ</button>
 <button onclick="Clip(2);">左右をクリップ</button><br>
 <button onclick="Clip(3);">上半分をクリップ</button>
 <button onclick="Clip(4);">下半分をクリップ</button><br>
 <button onclick="Clip(5);">左半分をクリップ</button>
 <button onclick="Clip(6);">右半分をクリップ</button>
</p>