html - How to make CSS animation jump rather than slide -
I have the following animation ...
Edit: Update for all browsers Bella. ..
Using the following CSS ...
.box {display: block; Width: 240px; Height: 100px; Background: Red URL ("http://southwestphotobooths.co.uk/sites/all/themes/SWPB/images/check_availability.png") No-repeat; Text Indent: -9999px; Status: Completed; -webkit- animation-name: change; Webkit-Animation-duration: 10s; Webkit-Animation-Timing-Function: Step (21); Webkit-animation-repetition-count: infinity; Webkit-Animation-direction: Normal; } @ -webkit-keyframes {0% {top: 0px; Left: 0px; Background-position: 0px 0px;} 5% {top: 0px; Left: 0px; Background-position: -240px 0px;} 10% {top: 0px; Left: 0px; Background-position: -480px px;} 15% {top: 0px; Left: 0px; Background-position: -720px px;} 20% {top: 0px; Left: 0px; Background-position: -960px 0px;} 25% {top: px; Left: 0px; Background-position: -1200px 0px;} 30% {top: 0px; Left: 0px; Background-position: -1440px 0px;} 35% {top: px; Left: 0px; Background-position: -1680px px;} 40% {top: 0px; Left: 0px; Background-position: -1920 px px;} 45% {top: 0px; Left: 0px; Background-position: -2160px 0px;} 50% {top: 0px; Left: 0px; Background-position: -2400px 0px;} 55% {top: 0px; Left: 0px; Background-position: -2640px px;} 60% {top: px; Left: 0px; Background-position: -2880px px;} 65% {top: 0px; Left: 0px; Background-position: -3120px px;} 70% {top: 0px; Left: 0px; Background-position: -3360px 0px;} 75% {top: 0px; Left: 0px; Background-position: -3600px 0px;} 80% {top: 0px; Left: 0px; Background-position: -3840px 0px;} 85% {top: 0px; Left: 0px; Background-position: -4080px px;} 90% {top: px; Left: 0px; Background-position: -4080px px;) 95% {top: 0px; Left: 0px; Background-position: -4080px px;} 100% {top: 0px; Left: 0px; Background-position: -4080px px;}}
It works on 21 steps using really broad PNG to act as a frame based on the background position is.
I can only get the animation instead of the twill Jump in the steps.
How do I jump from frame to frame with frame,
to your CSS Make changes like:
-webkit-animation-timing-function: steps (1); -moz-animation-timing function: step (1); Animation-timing function: step (1);
To get the desired animation, twitch them with different values, they currently show and close at each of the 21 frames. JSFiddle here:
Comments
Post a Comment