Во-первых, ваша анимация очень медленная на 40 секунд. Во-вторых, вам нужно включить все префиксные версии ключевых фреймов. Вы просто забыли -webkit
ключевых кадров.
Примечание: Нет необходимости в JQuery/JavaScript
Если вы хотите, чтобы стрелка вернуться ровно через не-зависание просто добавить transition
и его поставщик приставкой приятелей
Edit: Кажется, что вы хотите, гладкие назад и вперед, когда они парят, а не только гладкие, непрерывные в одном направлении. То же самое точное понятие просто изменить ключевые кадры:
a {
background-position: 90% center;
-webkit-transition: background-position 0.3s linear; /* Chrome 1-25, Safari 3.2+ */
-moz-transition: background-position 0.3s linear; /* Firefox 4-15 */
-o-transition: background-position 0.3s linear; /* Opera 10.50–12.00 */
transition: background-position 0.3s linear; /* Chrome 26, Firefox 16+, IE 10+, Opera 12.10+ */
}
a:hover {
background-position: 100% center;
-moz-animation: animatedBackground 2s infinite linear;
-o-animation: animatedBackground 2s infinite linear;
-webkit-animation: animatedBackground 2s infinite linear;
animation: animatedBackground 2s infinite linear;
}
@-moz-keyframes animatedBackground {
0% {
background-position: 90% center;
}
50% {
background-position: 100% center;
}
100% {
background-position: 90% center;
}
}
@-webkit-keyframes animatedBackground {
0% {
background-position: 90% center;
}
50% {
background-position: 100% center;
}
100% {
background-position: 90% center;
}
}
@-o-keyframes animatedBackground {
0% {
background-position: 90% center;
}
50% {
background-position: 100% center;
}
100% {
background-position: 90% center;
}
}
@-ms-keyframes animatedBackground {
0% {
background-position: 90% center;
}
50% {
background-position: 100% center;
}
100% {
background-position: 90% center;
}
}
@keyframes animatedBackground {
0% {
background-position: 90% center;
}
50% {
background-position: 100% center;
}
100% {
background-position: 90% center;
}
}
Вот непрерывный (справа от) версии стрелки:
a {
background-position: 90% center;
-webkit-transition: background-position 0.3s linear; /* Chrome 1-25, Safari 3.2+ */
-moz-transition: background-position 0.3s linear; /* Firefox 4-15 */
-o-transition: background-position 0.3s linear; /* Opera 10.50–12.00 */
transition: background-position 0.3s linear; /* Chrome 26, Firefox 16+, IE 10+, Opera 12.10+ */
}
a:hover {
background-position: 100% center;
-moz-animation: animatedBackground 2s infinite linear;
-o-animation: animatedBackground 2s infinite linear;
-webkit-animation: animatedBackground 2s infinite linear;
animation: animatedBackground 2s infinite linear;
}
@-moz-keyframes animatedBackground {
0% {
background-position: 90% center;
}
100% {
background-position: 100% center;
}
}
@-webkit-keyframes animatedBackground {
0% {
background-position: 90% center;
}
100% {
background-position: 100% center;
}
}
@-o-keyframes animatedBackground {
0% {
background-position: 90% center;
}
100% {
background-position: 100% center;
}
}
@-ms-keyframes animatedBackground {
0% {
background-position: 90% center;
}
100% {
background-position: 100% center;
}
}
@keyframes animatedBackground {
0% {
background-position: 90% center;
}
100% {
background-position: 100% center;
}
}
Есть 'from to from', чтобы он не возвращался назад, а оглядывался назад? –
@Howdy_McGee Хорошо, взгляните на это сейчас .. обновили ссылки .. есть два варианта, оба из которых являются гладкими. –
Работает как очарование! спасибо –