不知大家有没有注意到图片有一道高亮光弧闪过很炫的效果,其原理很简单可以用css3动画就可以做出这样的效果,用css3动画控制position:absolute的left值,从左向右闪过,这个具体的请看以下代码鼠标houver在盒子box上时动画会停止,代码如下:
CSS3动画实现高亮光弧效果body{margin:0;padding:0;}
.box{width:1000px;margin:200px auto;height:500px;position:relative;text-align:center;}
.box:hover .rolled{
-webkit-animation-play-state:paused;
-moz-animation-play-state:paused;
-o-animation-play-state:paused;
-ms-animation-play-state:paused;
}
.rolled{
position:absolute;
top: 0;
width:80px;
height:500px;
background: -moz-linear-gradient(left,rgba(255,255,255,0)0,rgba(255,255,255,.2)50%,rgba(255,255,255,0)100%);
background: -webkit-gradient(linear,left top,right top,color-stop(0%,rgba(255,255,255,0)),color-stop(50%,rgba(255,255,255,.2)),color-stop(100%,rgba(255,255,255,0)));
backgroun