效果:
實現(xiàn)原理:
transform: skew() + transition 實現(xiàn)
代碼:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
#box{
margin: 50px auto;
width: 430px;
height: 540px;
background: url(../img/sg.jpg) no-repeat;
position: relative;
overflow: hidden;
}
#box #sg{
width: 30px;
height: 540px;
left: -185px;
background: linear-gradient(left,transparent,rgba(255,255,255,0.6),transparent);
background: -moz-linear-gradient(left,transparent,rgba(255,255,255,0.6),transparent);
position: absolute;
transform: skew(-30deg,0);
}
#box:hover #sg{
left: 585px;
transition: left 1s;
}
</style>
</head>
<body>
<div id="box">
<div id="sg">
</div>
</div>
</body>
</html>
如有問題歡迎交流匙睹。
如轉(zhuǎn)載請注明出處,謝謝瑟由!