采用:target来实现锚点的动画
本代码片段来自gruntjs的官方文档:
比如: http://gruntjs.com/configuring-tasks#files
<a class="anchor" href="#files" name="files">Files</a>
@keyframes 'blink'{
0%{opacity:1.0}
50%{opacity:.0}
100%{opacity:1.0}
}
@-webkit-keyframes 'blink'{
0%{opacity:1.0}
50%{opacity:.0}
100%{opacity:1.0}
}
a.anchor:target {
-webkit-animation-name: blink;
-webkit-animation-direction: normal;
-webkit-animation-duration: .5s;
-webkit-animation-iteration-count: 2;
-webkit-animation-timing-function: ease;
animation-name: blink;
animation-direction: normal;
animation-duration: .5s;
animation-iteration-count: 2;
animation-timing-function: ease;
} 相关推荐
echoes 2020-08-20
RainyX 2020-07-26
sunshineboyleng 2020-07-08
程序员俱乐部 2020-06-28
zhanghao 2020-06-16
e度空间 2020-06-11
sunshineboyleng 2020-06-04
bertzhang 2020-06-02
xtuhcy 2020-05-20
tichangde 2020-05-19
sunshineboyleng 2020-04-27
coulder 2020-03-07