I zbudował coś, co miało na celu naśladować efekt przesuwania na iOS może być ostatnio użyty do sortowania jQuery. Możesz go zobaczyć na żywo na stronie tastemakerx.com, gdzie użyłem go, by ulepszyć funkcję sortowania kolekcji.
Oto skrzypce Zacząłem: http://jsfiddle.net/jozecuervo/fv8vR/
i tu jest CSS:
@-webkit-keyframes shake {
0%, 100% {-webkit-transform: translateX(0) rotate(0deg) translateY(0);}
15%, 35%, 55%, 75%, 95% {-webkit-transform: translateX(-1px) rotate(-2deg) ;}
25%, 45%, 65%, 85% {-webkit-transform: translateX(1px) rotate(2deg); }
10%, 30%, 50%, 70%, 90% {-webkit-transform: translateY(1px);}
20%, 40%, 60%, 80% {-webkit-transform: translateY(-1px); }
}
@-moz-keyframes shake {
0%, 100% {-moz-transform: translateX(0) rotate(0deg) translateY(0);}
15%, 35%, 55%, 75%, 95% {-moz-transform: translateX(-1px) rotate(-2deg) ;}
25%, 45%, 65%, 85% {-moz-transform: translateX(1px) rotate(2deg); }
10%, 30%, 50%, 70%, 90% {-moz-transform: translateY(1px);}
20%, 40%, 60%, 80% {-moz-transform: translateY(-1px); }
}
@-o-keyframes shake {
0%, 100% {-o-transform: translateX(0) rotate(0deg) translateY(0);}
15%, 35%, 55%, 75%, 95% {-o-transform: translateX(-1px) rotate(-2deg) ;}
25%, 45%, 65%, 85% {-o-transform: translateX(1px) rotate(2deg); }
10%, 30%, 50%, 70%, 90% {-o-transform: translateY(1px);}
20%, 40%, 60%, 80% {-o-transform: translateY(-1px); }
}
@keyframes shake {
0%, 100% {transform: translateX(0) rotate(0deg) translateY(0);}
15%, 35%, 55%, 75%, 95% {transform: translateX(-1px) rotate(-2deg) ;}
25%, 45%, 65%, 85% {transform: translateX(1px) rotate(2deg); }
10%, 30%, 50%, 70%, 90% {transform: translateY(1px);}
20%, 40%, 60%, 80% {transform: translateY(-1px); }
}
.shake {
-webkit-animation-name: shake;
-moz-animation-name: shake;
-o-animation-name: shake;
animation-name: shake;
-webkit-animation-duration: 2s;
-moz-animation-duration: 2s;
-o-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-fill-mode: both;
-moz-animation-fill-mode: both;
-o-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-transition-timing-function:linear;
}
Naprawdę dobre wtyczki. Czy ktoś wie, czy Pan Stanciu uczestniczy w SO? – Mindwin
można to również zrobić za pomocą niestandardowego kodu, a następnie dlaczego wtyczka –
Tak, animacje CSS są teraz znacznie bardziej dostępne, 3 lata później. :) – isherwood