关键帧动画需要设置的css,是否使用关键帧显示CSS属性的动画效果?

我知道我不能displaynone和block之间转换,但我认为我可以做一些跨动画由这样做:是否使用关键帧显示CSS属性的动画效果?

li:nth-child(1) {

-webkit-animation: winkle 1s linear;

animation: winkle 1s linear;

}

li:nth-child(2) {

-webkit-animation: winkle 1s linear 1s;

animation: winkle 1s linear 1s;

}

li:nth-child(3) {

-webkit-animation: winkle 1s linear 2s;

animation: winkle 1s linear 2s;

}

li:nth-child(4) {

-webkit-animation: winkle 1s linear 3s;

animation: winkle 1s linear 3s;

}

li:nth-child(5) {

-webkit-animation: winkle 1s linear 4s;

animation: winkle 1s linear 4s;

}

@-webkit-keyframes winkle {

0%, 100% {

display: none;

}

1%,

99% {

display: block

}

}

@keyframes winkle {

0%, 100% {

display: none;

}

1%,

99% {

display: block

}

}

  • Item 1
  • Item 2
  • Item 3
  • Item 4

但实际上这是不工作。你能证实这是不可能的吗?还有其他解决方案吗?我想到了这一点,但它也不起作用。如果你能想出更好的东西,将不胜感激。

li:nth-child(1) {

-webkit-animation: winkle 1s linear;

animation: winkle 1s linear;

}

li:nth-child(2) {

-webkit-animation: winkle 1s linear 1s;

animation: winkle 1s linear 1s;

}

li:nth-child(3) {

-webkit-animation: winkle 1s linear 2s;

animation: winkle 1s linear 2s;

}

li:nth-child(4) {

-webkit-animation: winkle 1s linear 3s;

animation: winkle 1s linear 3s;

}

li:nth-child(5) {

-webkit-animation: winkle 1s linear 4s;

animation: winkle 1s linear 4s;

}

li {

overflow: hidden;

}

@-webkit-keyframes winkle {

0%, 100% {

height: 0;

color: red;

}

1%,

99% {

height: auto;

color: blue;

}

}

@keyframes winkle {

0%, 100% {

height: 0;

color: red;

}

1%,

99% {

height: auto;

color: blue;

}

}

  • Item 1
  • Item 2
  • Item 3
  • Item 4
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值