"
第一种方式:wobble--动画
CSS代码为:
.pages .p3 //代码效果参考:https://v.youku.com/v_show/id_XNjQwMDE4MzEzNg==.html
img{ Width</span>: 100%;}.item-01{ position: absolute; left: 20px; top: 10px; Width</span>: 300px;-webkit-animation: wobble 2s ease 0s 1 both;}
.item-02{ position: absolute; left: 250px; top: 300px; Width</span>: 300px;-webkit-animation: wobble 1.5s infinite ease-in-out;}
@-webkit-keyframes wobble{0%{-webkit-transform:none;transform:none}
15%{-webkit-transform:translate3d(-25%,0,0) rotate3d(0,0,1,-5deg);transform:translate3d(-25%,0,0) rotate3d(0,0,1,-5deg)}
30%{-webkit-transform:translate3d(20%,0,0) rotate3d(0,0,1,3deg);transform:translate3d(20%,0,0) rotate3d(0,0,1,3deg)}
45%{-webkit-transform:translate3d(-15%,0,0) rotate3d(0,0,1,-3deg);transform:translate3d(-15%,0,0) rotate3d(0,0,1,-3deg)}
60%{-webkit-transform:translate3d(10%,0,0) rotate3d(0,0,1,2deg);transform:translate3d(10%,0,0) rotate3d(0,0,1,2deg)}
75%{-webkit-transform:translate3d(-5%,0,0) rotate3d(0,0,1,-1deg);transform:translate3d(-5%,0,0) rotate3d(0,0,1,-1deg)}
100%{-webkit-transform:none;transform:none}
}
@keyframes wobble{0%{-webkit-transform:none;transform:none}
15%{-webkit-transform:translate3d(-25%,0,0) rotate3d(0,0,1,-5deg);transform:translate3d(-25%,0,0) rotate3d(0,0,1,-5deg)}
30%{-webkit-transform:translate3d(2//代码效果参考:https://v.youku.com/v_show/id_XNjQwMDE4OTM2NA==.html
0%,0,0) rotate3d(0,0,1,3deg);transform:translate3d(20%,0,0) rotate3d(0,0,1,3deg)}45%{-webkit-transform:translate3d(-15%,0,0) rotate3d(0,0,1,-3deg);transform:translate3d(-15%,0,0) rotate3d(0,0,1,-3deg)}
60%{-webkit-transform:translate3d(10%,0,0) rotate3d(0,0,1,2deg);transform:translate3d(10%,0,0) rotate3d(0,0,1,2deg)}
75%{-webkit-transform:translate3d(-5%,0,0) rotate3d(0,0,1,-1deg);transform:translate3d(-5%,0,0) rotate3d(0,0,1,-1deg)}
100%{-webkit-transform:none;transform:none}
}
.wobble{-webkit-animation-name:wobble;animation-name:wobble}
本地效果为:app/html5_animation/wobble.html
"