据我了解,clip是可以剪切图片的,但是实际上clip只是不显示全部图片而已,位置还是占那么多的。
比如下面一段代码:
<html>
<head>
<style type="text/css">
img
{
position:absolute;
top:100px;
}
</style>
<script type="text/javascript">
function clipImage()
{
document.getElementById("img1").style.clip="rect(0px,50px,50px,0px)";
}
</script>
</head>
<body>
<img id="img1" border="0" src="http://img04.taobaocdn.com/imgextra/i4/415165877/T2JVyLXf8bXXXXXXXX_!!415165877.jpg" />
<input type="button" onclick=clipImage() value="Clip image" />
</body>
</html>
实际效果是:
请问:有没办法既能够剪切图片,图片又可以不完成占位的呢?