中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Style clip 屬性

Style 對象參考手冊 Style 對象

定義和用法

clip 屬性設置或返回定位元素的可見部分。

語法

設置 clip 屬性:

Object.style.clip="auto|rect(top right bottom left)|inherit"

返回 clip 屬性:

Object.style.clip
描述
auto 默認。元素沒有剪輯。
rect(top right bottom left) 剪輯的形狀由四個坐標定義。
inherit clip 屬性的值從父元素繼承。

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 clip 屬性。

注意:IE7 及更早的版本不支持 "inherit" 值。IE8 只有規(guī)定了 !DOCTYPE 才支持 "inherit"。IE9 支持 "inherit"。


實例

實例

剪輯圖像為指定的形狀:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小白教程(json.cn)</title>
<style type="text/css">
img{
position:absolute;
????top:100px;
}
</style>
<script>
function clipImage(){
????document.getElementById("img1").style.clip="rect(0px 75px 75px 0px)";
}
function clearClip(){
????document.getElementById("img1").style.clip="auto";
}
</script>
</head>
<body>

<img id="img1" src="w3javascript.gif" width="100" height="132">
<input type="button" onclick=clipImage() value="裁剪圖片">
<input type="button" onclick=clearClip() value="不裁剪圖片">

</body>
</html>

運行代碼 ?

Style 對象參考手冊 Style 對象其他擴展