0
在this Fiddle,我試圖在我的容器元素中獲得「發光」效果。Webkit動畫徑向漸變?
#box {
width: 100px;
height: 100px;
margin: 10px;
animation: glow 2s ease-in-out infinite alternate;
-webkit-animation: glow 2s ease-in-out infinite alternate;
}
@keyframes glow {
from {background-image:radial-gradient(circle farthest-side at center, rgba(255,0,0,0) 24px, rgba(255,0,0,1) 24px, rgba(255,0,0,0) 24px);}
to {background-image:radial-gradient(circle farthest-side at center, rgba(255,0,0,0) 24px, rgba(255,0,0,1) 24px, rgba(255,0,0,0) 48px);}
}
@-webkit-keyframes glow {
from {background-image:-webkit-radial-gradient(center,circle farthest-side, rgba(255,0,0,0) 24px, rgba(255,0,0,1) 24px, rgba(255,0,0,0) 24px);}
to {background-image:-webkit-radial-gradient(center,circle farthest-side, rgba(255,0,0,0) 24px, rgba(255,0,0,1) 24px, rgba(255,0,0,0) 48px);}
}
它在IE10中工作,但由於某種原因在Chrome中它只呈現「到」狀態並且根本不動畫。 Webkit中的漸變是否具有動畫效果?