CSS Animation Delay for individual divs -
i trying 3 items come in 1 after other. far using same animation , delay working seperate them out each come in 1.5s apart. want avoid repeating of animation code in css. here code:
html
<!-- footer tagline --> <div id="ftr-tagline"> <div id="ftr1-animation" class="slideleft"> <div class="one-third"> <div class="one-call"> 1 call... </div><!-- .one-call --> </div><!-- .one-third --> </div><!-- #ftr1-animation --> <div id="ftr2-animation" class="slideleft"> <div class="one-third"> <div class="one-contact"> 1 contact... </div><!-- .one-contact --> </div><!-- .one-third --> </div><!-- #ftr2-animation --> <div id="ftr3-animation" class="slideleft"> <div class="one-third last"> <div class="one-culture"> 1 culture... </div> <!-- .one-contact --> </div><!-- .one-third --> </div> <!-- #ftr3-animation --> </div> <!-- #ftr-tagline --> <!-- end footer tagline -->
css:
/* animations */ #title-animation, #ftr1-animation, #ftr2-animation, #ftr3-animation{ /*background-color: #fe5652;*/ visibility: hidden; } /* ============================================== slideleft ============================================== */ .slideleft{ animation-name: slideleft; -webkit-animation-name: slideleft; animation-duration: 1s; -webkit-animation-duration: 1s; animation-timing-function: ease-in-out; -webkit-animation-timing-function: ease-in-out; -webkit-animation-delay: 1.5s; /* safari , chrome */ animation-delay: 1.5s; visibility: visible !important; } @keyframes slideleft { 0% {transform: translatex(150%);} 100% {transform: translatex(0%);} } @-webkit-keyframes slideleft { 0% {-webkit-transform: translatex(150%);} 100% {-webkit-transform: translatex(0%);} }
instead of applying delay 3 divs (.slideleft
), apply delay separately each div:
#ftr2-animation { -webkit-animation-delay: 1.5s; animation-delay: 1.5s; } #ftr3-animation { -webkit-animation-delay: 3s; animation-delay: 3s; }
here demo: http://jsfiddle.net/8jtg5/
Comments
Post a Comment