css3 抖动效果

.shaky {
        -webkit-animation-name: shaky-slow;
        -ms-animation-name: shaky-slow;
        animation-name: shaky-slow;
        -webkit-animation-duration: 0.5s;
        -ms-animation-duration: 0.5s;
        animation-duration: 0.5s;
        -webkit-animation-iteration-count: 2;
        -ms-animation-iteration-count: 2;
        animation-iteration-count: 2;
        -webkit-animation-timing-function: ease-in-out;
        -ms-animation-timing-function: ease-in-out;
        animation-timing-function: ease-in-out;
        -webkit-animation-play-state: running;
        -ms-animation-play-state: running;
        animation-play-state: running;
    }
@-webkit-keyframes shaky-slow {
	30% {
		-webkit-transform: translateY(10px);
	}
	60% {
	    -webkit-transform: translateY(-10px);
	}
	80% {
	          -webkit-transform: translateY(10px);
	      }
	100% {
	          -webkit-transform: translateY(0);
	      }
	80% {
	          -webkit-transform: translateY(10px);
	      }
	60% {
	          -webkit-transform: translateY(-10px);
	      }
	30% {
	          -webkit-transform: translateY(10px);
	      }
	  }
// @-webkit-keyframes shaky-slow {  // 第二种效果
//   20% {
//       -webkit-transform: rotate(-0.5deg);
//   }
//   40% {
//       -webkit-transform: rotate(-0.5deg);
//   }
//   60% {
//       -webkit-transform: rotate(-0.5deg);
//   }
//   80% {
//       -webkit-transform: rotate(2deg);
//   }
//   90% {
//       -webkit-transform: rotate(-2deg);
//   }
//   100% {
//       -webkit-transform: rotate(0deg);
//   }
// }
<p class="shaky">文字文字文字</p>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值