Hi please look at this script and tell me how to flip A B and C divs in time intervals. I want A to flip first then it stops, B flips next and stops, and C next and Back to A, B and C again like in a loop and start it over again. Is this possible in CSS3 ? In this code all the divs flip on the same time.
/* ::: HOLDER, CARD, FACES */
.holder {
display: inline-block;
width: 64px;
height: 64px;
perspective: 700px;
}
.card, .front, .back{
position: absolute;
height: inherit;
width: inherit;
transition: all .7s;
transform-style: preserve-3d;
backface-visibility: hidden;
}
/* ::: FACES */
.front{background: tomato;}
.back{background: slategray;}
/* ::: SETUP FACES */
.flipH .back{transform: rotateY(-180deg);}
.flipV .back{transform: rotateX(180deg);}
/* ::: HOVER EFFECTS (Remove Automated for this to work) */
.flipH:hover .card{ transform: rotateY(180deg); }
.flipV:hover .card{ transform: rotateX(-180deg); }
/* ::: AUTOMATED EFFECTS */
.flipH .card{
animation: flipH 2s 0s infinite alternate ease-in-out;
-webkit-animation: flipH 2s 0s infinite alternate ease-in-out;
}
.flipV .card{
animation: flipV 2s 0s infinite alternate ease-in-out;
-webkit-animation: flipV 2s 0s infinite alternate ease-in-out;
}
#keyframes flipH {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(-180deg); }
}
#-webkit-keyframes flipH {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(-180deg); }
}
#keyframes flipV {
0% { transform: rotateX(0deg); }
100% { transform: rotateX(-180deg); }
}
#-webkit-keyframes flipV {
0% { transform: rotateX(0deg); }
100% { transform: rotateX(-180deg); }
}
<div class="holder flipH">
<div class="card">
<div class="front">A</div>
<div class="back">A</div>
</div>
</div>
<div class="holder flipV">
<div class="card">
<div class="front">B</div>
<div class="back">B</div>
</div>
</div>
<div class="holder flipH">
<div class="card">
<div class="front">C</div>
<div class="back">C</div>
</div>
</div>
As Maddy says, animation delay is the trick
/* ::: HOLDER, CARD, FACES */
.holder {
display: inline-block;
width: 64px;
height: 64px;
perspective: 700px;
}
.card, .front, .back{
position: absolute;
height: inherit;
width: inherit;
transition: all .7s;
transform-style: preserve-3d;
backface-visibility: hidden;
}
/* ::: FACES */
.front{background: tomato;}
.back{background: slategray;}
/* ::: SETUP FACES */
.flipH .back{transform: rotateY(-180deg);}
.flipV .back{transform: rotateX(180deg);}
/* ::: HOVER EFFECTS (Remove Automated for this to work) */
.flipH:hover .card{ transform: rotateY(180deg); }
.flipV:hover .card{ transform: rotateX(-180deg); }
/* ::: AUTOMATED EFFECTS */
.flipH .card{
animation: flipH 3s 0s infinite alternate ease-in-out;
-webkit-animation: flipH 3s 0s infinite alternate ease-in-out;
}
.flipV .card{
animation: flipV 3s 1s infinite alternate ease-in-out;
-webkit-animation: flipV 3s 1s infinite alternate ease-in-out;
}
.flipH:nth-child(3) .card {
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
#keyframes flipH {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(-180deg); }
}
#-webkit-keyframes flipH {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(-180deg); }
}
#keyframes flipV {
0% { transform: rotateX(0deg); }
100% { transform: rotateX(-180deg); }
}
#-webkit-keyframes flipV {
0% { transform: rotateX(0deg); }
100% { transform: rotateX(-180deg); }
}
<div class="holder flipH">
<div class="card">
<div class="front">A</div>
<div class="back">A</div>
</div>
</div>
<div class="holder flipV">
<div class="card">
<div class="front">B</div>
<div class="back">B</div>
</div>
</div>
<div class="holder flipH">
<div class="card">
<div class="front">C</div>
<div class="back">C</div>
</div>
</div>
There is in css3 2 type of tag animation-delay and animation-iteration-count, you need to google for that.
I think you want something like this-
.holder {
display: inline-block;
width: 64px;
height: 64px;
perspective: 700px;
}
.card, .front, .back{
position: absolute;
height: inherit;
width: inherit;
transition: all .7s;
transform-style: preserve-3d;
backface-visibility: hidden;
}
/* ::: FACES */
.front{background: tomato;}
.back{background: slategray;}
/* ::: SETUP FACES */
.flipH .back{transform: rotateY(-180deg);}
.flipV .back{transform: rotateX(180deg);}
/* ::: HOVER EFFECTS (Remove Automated for this to work) */
.flipH:hover .card{ transform: rotateY(180deg); }
.flipV:hover .card{ transform: rotateX(-180deg); }
/* ::: AUTOMATED EFFECTS */
.flipH .card{
animation: flipH 2s 0s 1 alternate ease-in-out;
-webkit-animation: flipH 2s 0s infinite alternate ease-in-out;
}
.flipV .card{
animation: flipV 2s 1s 1 alternate ease-in-out;
-webkit-animation: flipV 2s 0s infinite alternate ease-in-out;
}
.flipH.flipH2 .card{
animation: flipH 2s 2s 1 alternate ease-in-out;
-webkit-animation: flipH 2s 0s infinite alternate ease-in-out;
}
#keyframes flipH {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(-180deg); }
}
#-webkit-keyframes flipH {
0% { transform: rotateY(0deg); }
100% { transform: rotateY(-180deg); }
}
#keyframes flipV {
0% { transform: rotateX(0deg); }
100% { transform: rotateX(-180deg); }
}
#-webkit-keyframes flipV {
0% { transform: rotateX(0deg); }
100% { transform: rotateX(-180deg); }
}
<div class="holder flipH">
<div class="card">
<div class="front">A</div>
<div class="back">A</div>
</div>
</div>
<div class="holder flipV">
<div class="card">
<div class="front">B</div>
<div class="back">B</div>
</div>
</div>
<div class="holder flipH flipH2">
<div class="card">
<div class="front">C</div>
<div class="back">C</div>
</div>
</div>
I hope it will helps you.
Related
Blockquote
Hi people, i have an image gallery with grid and i want to put an Animista animation when user click on image , i tried to use hover on the class but there is an specificity error.
Blockquote
css:
img :hover{
.scale-up-center {
-webkit-animation: scale-up-center 0.7s cubic-bezier(0.550, 0.055, 0.675, 0.190) both;
animation: scale-up-center 0.7s cubic-bezier(0.550, 0.055, 0.675, 0.190) both;
}
#-webkit-keyframes scale-up-center {
0% {
-webkit-transform: scale(0.5);
transform: scale(0.5);
}
100% {
-webkit-transform: scale(1);
transform: scale(1);
}
}
#keyframes scale-up-center {
0% {
-webkit-transform: scale(0.5);
transform: scale(0.5);
}
100% {
-webkit-transform: scale(3);
transform: scale(3);
}
}
}
html :
<div class="grid">div class="modulo">
<div class="producto" data-name="p-9">
<img class="scale-up-center"src="Img/Pastel.jpg" alt="Pastel">
<h3>Pastel</h3>
<div class="info">Las medidas son : alto:47 cm, ancho : 54 cm</div>
</div>
</div>
:hover selector is activated by moving mouse over an element. You need to use focus. To do that tabindex also needs to be set. Here is a demo:
.producto {
overflow: hidden
}
.producto img:focus {
animation: scale-up-center 0.7s cubic-bezier(0.550, 0.055, 0.675, 0.190) backwards;
}
.producto img:active {
animation: none;
}
#keyframes scale-up-center {
0% {
transform: scale(0.5);
}
100% {
transform: scale(3);
}
}
<div class="grid">
<div class="modulo">
<div class="producto" data-name="p-9">
<img tabindex="0" src="https://placekitten.com/100/100" alt="Pastel">
<h3>Pastel</h3>
<div class="info">Las medidas son : alto:47 cm, ancho : 54 cm</div>
</div>
</div>
</div>
It's been a while since I asked a question here. So excuse me if I do anything wrong.
I have an issue with CSS animation. I would like my animation to keep repeating it self but without loosing the initial effects. However it seems like there is a bug either in my code or in CSS animation behavior.
After it completes first 2 rotate animations (spin, spinback) defined. The loop begins but the new animation is not as same as before.
My goal is to create rotate animation on 6 boxes in order, one at a time. When all boxes turned, they should start turning back to original state again in order, one by one.
Code:
/* -------------------------------------------------------- */
#loader {
width: 240px;
height: 100px;
}
.inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 2s;
transform-style: preserve-3d;
background-color: transparent;
}
.front,
.back {
position: absolute;
width: 80px;
height: 50px;
backface-visibility: hidden;
}
/* -------------------------------------------------------- */
#loader1 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader1 .inner {
animation: spin 10s ease 0s infinite, spinback 10s ease 10s infinite;
-webkit-animation: spin 10s ease 0s infinite, spinback 10s ease 10s infinite;
}
#loader1 .front {
background-color: #db9834;
}
#loader1 .back {
background-color: #3498db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader2 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader2 .inner {
animation: spin 10s ease 1s infinite, spinback 10s ease 11s infinite;
-webkit-animation: spin 10s ease 1s infinite, spinback 10s ease 11s infinite;
}
#loader2 .front {
background-color: #db8834;
}
#loader2 .back {
background-color: #3488db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader3 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader3 .inner {
animation: spin 10s ease 2s infinite, spinback 10s ease 12s infinite;
-webkit-animation: spin 10s ease 2s infinite, spinback 10s ease 12s infinite;
}
#loader3 .front {
background-color: #db7834;
}
#loader3 .back {
background-color: #3478db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader4 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader4 .inner {
animation: spin 10s ease 3s infinite, spinback 10s ease 13s infinite;
-webkit-animation: spin 10s ease 3s infinite, spinback 10s ease 13s infinite;
}
#loader4 .front {
background-color: #db6834;
}
#loader4 .back {
background-color: #3468db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader5 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader5 .inner {
animation: spin 10s ease 4s infinite, spinback 10s ease 14s infinite;
-webkit-animation: spin 10s ease 4s infinite, spinback 10s ease 14s infinite;
}
#loader5 .front {
background-color: #db5834;
}
#loader5 .back {
background-color: #3458db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader6 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader6 .inner {
animation: spin 10s ease 5s infinite, spinback 10s ease 15s infinite;
-webkit-animation: spin 10s ease 5s infinite, spinback 10s ease 15s infinite;
}
#loader6 .front {
background-color: #db4834;
}
#loader6 .back {
background-color: #3448db;
transform: rotateY(180deg);
}
#-webkit-keyframes spin {
0% {
-webkit-transform: rotateY(0deg);
}
16% {
-webkit-transform: rotateY(180deg);
}
100% {
-webkit-transform: rotateY(180deg);
}
}
#keyframes spin {
0% {
-webkit-transform: rotateY(0deg);
}
16% {
-webkit-transform: rotateY(180deg);
}
100% {
-webkit-transform: rotateY(180deg);
}
}
#-webkit-keyframes spinback {
0% {
-webkit-transform: rotateY(180deg);
}
16% {
-webkit-transform: rotateY(0deg);
}
100% {
-webkit-transform: rotateY(0deg);
}
}
#keyframes spinback {
0% {
-webkit-transform: rotateY(180deg);
}
16% {
-webkit-transform: rotateY(0deg);
}
100% {
-webkit-transform: rotateY(0deg);
}
}
<div id="loader">
<div id="loader1">
<div class="inner">
<div class="front">
</div>
<div class="back"> </div>
</div>
</div>
<div id="loader2">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
<div id="loader3">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
<div id="loader4">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
<div id="loader5">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
<div id="loader6">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
</div>
Just to make it more understandable I am trying to apply css flipcard method:
https://www.w3schools.com/howto/howto_css_flip_card.asp
On divs in order to create a look like something is loading...
The animation only gives timing to trigger keyframes in right timing then in key frames I am rotating divs and putting a wait time until oter divs finishes their rotation. So formula is 6 box in 10sec which is gonna be somewhere between (0% to 100%) so (100 / 6 = 16,6) which I take the animation as should end at 16% of the animation time.
First I would simplify your code and use less HTML/CSS. Then I would consider only one animation where I will have both states.
The animation will be: the first flip then we keep the first color then the second filp then we keep the second color. It's divided into 12 time slots (1 + 5 + 1 + 5) (1+5 = 6 which is the number of the divs)
If the duration is S then the delay should be multiple of one slot S/12. Notice that I have used the perspective within the transform to avoid an extra element:
#loader {
width: 240px;
height: 100px;
display: flex;
flex-wrap: wrap;
}
#loader>div {
width: calc(100%/3);
position: relative;
transform-style: preserve-3d;
animation: spin 6s linear var(--delay, 0s) infinite;
}
#loader>div:before,
#loader>div:after {
content: "";
position: absolute;
top:0;
left:0;
width: 100%;
height: 100%;
backface-visibility: hidden;
background-color: var(--front, #db9834);
}
#loader>div:after {
background-color: var(--back, #3498db);
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader>div:nth-child(2) {
--front: #db8834;
--back: #3488db;
--delay: 0.5s;
}
#loader>div:nth-child(3) {
--front: #db7834;
--back: #3478db;
--delay: 1s;
}
#loader>div:nth-child(4) {
--front: #db6834;
--back: #3468db;
--delay: 1.5s;
}
#loader>div:nth-child(5) {
--front: #db5834;
--back: #3458db;
--delay: 2s;
}
#loader>div:nth-child(6) {
--front: #db4834;
--back: #3448db;
--delay: 2.5s;
}
#keyframes spin {
0% {
transform:perspective(500px) rotateY(0deg);
}
8.33%,
50%{
transform:perspective(500px) rotateY(180deg);
}
58.33% {
transform:perspective(500px) rotateY(0deg);
}
}
<div id="loader">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
Related questions for more details about the difference between perspective and perspective()
CSS 3d transform doesn't work if perspective is set in the end of property
perspective and translateZ moves diagonally
We can simplify more if we change the div coloration while rotating instead of having two elements. The change should be made at half the slot where we do the flip (first and sixth) without any transition to create the illusion:
#loader {
width: 240px;
height: 100px;
display: flex;
flex-wrap: wrap;
}
#loader>div {
width: calc(100%/3);
animation:
spin 6s linear var(--delay, 0s) infinite,
colors 6s linear var(--delay, 0s) infinite;
background-color: var(--front, #db9834);
}
/* -------------------------------------------------------- */
#loader>div:nth-child(2) {
--front: #db8834;
--back: #3488db;
--delay: 0.5s;
}
#loader>div:nth-child(3) {
--front: #db7834;
--back: #3478db;
--delay: 1s;
}
#loader>div:nth-child(4) {
--front: #db6834;
--back: #3468db;
--delay: 1.5s;
}
#loader>div:nth-child(5) {
--front: #db5834;
--back: #3458db;
--delay: 2s;
}
#loader>div:nth-child(6) {
--front: #db4834;
--back: #3448db;
--delay: 2.5s;
}
#keyframes spin {
0% {
transform:perspective(500px) rotateY(0deg);
}
8.33%,
50%{
transform:perspective(500px) rotateY(180deg);
}
58.33% {
transform:perspective(500px) rotateY(0deg);
}
}
#keyframes colors {
0%,4.15% {
background-color: var(--front, #db9834);
}
4.16% {
background-color: var(--back, #3498db);
}
54.15% {
background-color: var(--back, #3498db);
}
54.16% {
background-color: var(--front, #db9834);
}
}
<div id="loader">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
Another simplification can be done using filter considering the fact that you want to have the same shades of colors:
#loader {
width: 240px;
height: 100px;
display: flex;
flex-wrap: wrap;
}
#loader>div {
width: calc(100%/3);
animation:
spin 6s linear var(--delay, 0s) infinite,
colors 6s linear var(--delay, 0s) infinite;
background:
linear-gradient(#db9834 50%, #3498db 0);
background-size: 100% 200%;
}
/* -------------------------------------------------------- */
#loader>div:nth-child(2) {
filter: brightness(0.9);
--delay: 0.5s;
}
#loader>div:nth-child(3) {
filter: brightness(0.8);
--delay: 1s;
}
#loader>div:nth-child(4) {
filter: brightness(0.7);
--delay: 1.5s;
}
#loader>div:nth-child(5) {
filter: brightness(0.6);
--delay: 2s;
}
#loader>div:nth-child(6) {
filter: brightness(0.5);
--delay: 2.5s;
}
#keyframes spin {
0% {
transform:perspective(500px) rotateY(0deg);
}
8.33%,
50%{
transform:perspective(500px) rotateY(180deg);
}
58.33% {
transform:perspective(500px) rotateY(0deg);
}
}
#keyframes colors {
4.15% {
background-position: top;
}
4.16%,
54.15% {
background-position:bottom;
}
54.16% {
background-position: top;
}
}
<div id="loader">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
This result is not exactly the same as I used a random filter but you can easily try another kind of filtration to get the needed result.
A similar problem has already been described on SO: How to have the object not revert to its initial position after animation has run? The problem is that at the beginning of the animation, the object returns to its original state. But I solved the problem differently: I simply combined both animations into one, and now both reversals are described by one function. If you definitely need both animations, then redo it, as stated in the question I've given link to. Here is my code:
#loader {
width: 240px;
height: 100px;
}
.inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
transition: transform 2s;
transform-style: preserve-3d;
background-color: transparent;
}
.front,
.back {
position: absolute;
width: 80px;
height: 50px;
backface-visibility: hidden;
}
#loader1 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader1 .inner {
animation: spin 20s ease 0s infinite;
-webkit-animation: spin 20s ease 0s infinite;
}
#loader1 .front {
background-color: #db9834;
}
#loader1 .back {
background-color: #3498db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader2 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader2 .inner {
animation: spin 20s ease 1s infinite;
-webkit-animation: spin 20s ease 1s infinite;
}
#loader2 .front {
background-color: #db8834;
}
#loader2 .back {
background-color: #3488db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader3 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader3 .inner {
animation: spin 20s ease 2s infinite;
-webkit-animation: spin 20s ease 2s infinite;
}
#loader3 .front {
background-color: #db7834;
}
#loader3 .back {
background-color: #3478db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader4 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader4 .inner {
animation: spin 20s ease 3s infinite;
-webkit-animation: spin 20s ease 3s infinite;
}
#loader4 .front {
background-color: #db6834;
}
#loader4 .back {
background-color: #3468db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader5 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader5 .inner{
animation: spin 20s ease 4s infinite;
-webkit-animation: spin 20s ease 4s infinite;
}
#loader5 .front {
background-color: #db5834;
}
#loader5 .back {
background-color: #3458db;
transform: rotateY(180deg);
}
/* -------------------------------------------------------- */
#loader6 {
float: left;
width: 80px;
height: 50px;
perspective: 1000px;
background-color: transparent;
}
#loader6 .inner {
animation: spin 20s ease 5s infinite;
-webkit-animation: spin 20s ease 5s infinite;
}
#loader6 .front {
background-color: #db4834;
}
#loader6 .back {
background-color: #3448db;
transform: rotateY(180deg);
}
#-webkit-keyframes spin {
0% {
-webkit-transform: rotateY(0deg);
}
8% {
-webkit-transform: rotateY(180deg);
}
50% {
-webkit-transform: rotateY(180deg);
}
58% {
-webkit-transform: rotateY(0deg);
}
100% {
-webkit-transform: rotateY(0deg);
}
}
#keyframes spin {
0% {
-webkit-transform: rotateY(0deg);
}
8% {
-webkit-transform: rotateY(180deg);
}
50% {
-webkit-transform: rotateY(180deg);
}
58% {
-webkit-transform: rotateY(0deg);
}
100% {
-webkit-transform: rotateY(0deg);
}
}
<div id="loader">
<div id="loader1">
<div class="inner">
<div class="front">
</div>
<div class="back"> </div>
</div>
</div>
<div id="loader2">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
<div id="loader3">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
<div id="loader4">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
<div id="loader5">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
<div id="loader6">
<div class="inner">
<div class="front"> </div>
<div class="back"> </div>
</div>
</div>
</div>
In the slideshow shown below, there are two images available. Once clicking on a button for the second image after first opening my page, there is a sudden jump to that image with no 5 second transition as expected. Also when doing this, I notice that #slideshowimage-2 is shown in the url (doing this offline) after clicking the button for that image. Here's the code below:
CSS:
.slideshowcontainer {
width:800px;
height:400px;
margin-left:auto;
margin-right:auto;
margin-top:0px;
text-align:center;
overflow:hidden;
position:relative;
top:30px;
border-style:solid;
border-width:10px;
border-color:white;
border-radius:15px;
}
.imagecontainer {
width:1800px;
height:400px;
clear: both;
position:relative;
-webkit-transition:left 3s;
-moz-transition:left 3s;
-o-transition:left 3s;
-ms-transition:left 3s;
transition:left 3s;
animation:scroller 16s infinite;
}
#keyframes scroller {
0% {transform:translateX(0);}
31.25% {transform:translateX(0);}
50% {transform:translateX(-800px);}
81.25% {transform:translateX(-800px);}
100% {transform:translateX(0);}
}
.slideshowimage {
float:left;
margin:0px;
padding:0px;
position:relative;
}
#keyframes change {
0% {
transform: translateX(-800px);
}
100% {
transform: translateX(0);
animation: scroller 16s infinite;
}
}
#keyframes change2 {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-800px);
animation: scroller2 16s infinite;
}
}
#slideshowimage-1:target ~ .imagecontainer {
animation: none;
transform: translateX(0px);
animation: change 3s forwards;
}
#slideshowimage-2:target ~ .imagecontainer {
animation: none;
transform: translateX(-800px);
animation: change2 3s forwards;
}
.buttoncontainer {
position:relative;
top:-20px;
}
.button {
display:inline-block;
height:10px;
width:10px;
border-radius:10px;
background-color:darkgray;
-webkit-transition:background-color 0.25s;
-moz-transition:background-color 0.25s;
-o-transition:background-color 0.25s;
-ms-transition:background-color 0.25s;
transition:background-color 0.25s;
}
.button:hover {
background-color:gray;
}
HTML:
<div class="slideshowcontainer">
<span id="slideshowimage-1"></span>
<span id="slideshowimage-2"></span>
<span id="slideshowimage-3"></span>
<div class="imagecontainer">
<img src="WebServiceSlide.png" class="slideshowimage" style="width:800px;height:400px;">
<img src="es-flag.png" class="slideshowimage" style="width:800px;height:400px;">
</div>
<div class="buttoncontainer">
</div>
</div>
How could I make it so that the transition set upon clicking a button occurs on the first click? Many thanks in advance.
Reason:-
Because the left and translateX both are different. If you apply left:-800px when slide is at translateX(-800px) (2nd slide) then animation will continue at the 2nd part of slideshow. Thats why you are seeing a blank white space(when translateX(-800px) accors when it is already left:-800px).
Solution:-
You either have to use translateX or left. use the same in all the places
Part of code that solved the problem:-
#keyframes change {
0% {
transform: translateX(-800px);
}
100% {
transform: translateX(0);
animation: scroller 16s infinite;
}
}
#keyframes change2 {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-800px);
animation: scroller2 16s infinite;
}
}
#slideshowimage-1:target ~ .imagecontainer {
animation: none;
transform: translateX(0px);
animation: change 3s forwards;
}
#slideshowimage-2:target ~ .imagecontainer {
animation: none;
transform: translateX(-800px);
animation: change2 3s forwards;
}
Explanation:-
This code doesn't do translateX manually. Instead it uses animation to scoll single time by animation: change 3s forwards;
Drawback:-
Once we click on the slide selection button the animation stops. I have even tried it to solve by adding animation in the change keyframes animate end section. But unfortunately it didn't work. So I would suggest an alternate method to overcome the drawback as follows
To overcome the drawback I have added a play button which
will replay the slideshow animation which got paused by the slide
button. (Once we click on play button it takes a little time to slide
as we have given 16s in animation)
DEMO:-
.slideshowcontainer {
width: 800px;
height: 400px;
margin-left: auto;
margin-right: auto;
margin-top: 0px;
text-align: center;
overflow: hidden;
position: relative;
top: 30px;
border-style: solid;
border-width: 10px;
border-color: white;
border-radius: 15px;
}
.imagecontainer {
width: 1800px;
height: 400px;
clear: both;
position: relative;
-webkit-transition: all 3s;
-moz-transition: all 3s;
-o-transition: all 3s;
-ms-transition: all 3s;
transition: all 3s;
transform: translateX(0px);
animation: scroller 16s infinite;
}
#keyframes scroller {
0% {
transform: translateX(0);
}
31.25% {
transform: translateX(0);
}
50% {
transform: translateX(-800px);
}
81.25% {
transform: translateX(-800px);
}
100% {
transform: translateX(0);
}
}
#keyframes scroller2 {
0% {
transform: translateX(-800px);
}
31.25% {
transform: translateX(-800px);
}
50% {
transform: translateX(0);
}
81.25% {
transform: translateX(0);
}
100% {
transform: translateX(-800px);
}
}
#keyframes change {
0% {
transform: translateX(-800px);
}
100% {
transform: translateX(0);
animation: scroller 16s infinite;
}
}
#keyframes change2 {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-800px);
animation: scroller2 16s infinite;
}
}
.slideshowimage {
float: left;
margin: 0px;
padding: 0px;
position: relative;
}
#slideshowimage-1:target ~ .imagecontainer {
animation: none;
transform: translateX(0px);
animation: change 3s forwards;
}
#slideshowimage-2:target ~ .imagecontainer {
animation: none;
transform: translateX(-800px);
animation: change2 3s forwards;
}
#slideshowimage-3:target ~ .imagecontainer {
transform: translateX(0);
animation: scroller 16s infinite;
}
.buttoncontainer {
position: relative;
top: -20px;
}
.button {
display: inline-block;
height: 10px;
width: 10px;
border-radius: 10px;
background-color: darkgray;
-webkit-transition: background-color 0.25s;
-moz-transition: background-color 0.25s;
-o-transition: background-color 0.25s;
-ms-transition: background-color 0.25s;
transition: background-color 0.25s;
}
.button:hover {
background-color: gray;
}
.buttonplay:after {
height: 0;
width: 0;
top: 0;
margin-left: 10px;
position: absolute;
content: ' ';
border-left: solid 13px darkgray;
border-top: solid 8px transparent;
border-bottom: solid 8px transparent;
}
<div class="slideshowcontainer">
<span id="slideshowimage-1"></span>
<span id="slideshowimage-2"></span>
<span id="slideshowimage-3"></span>
<div class="imagecontainer">
<img src="https://placehold.it/800x400" class="slideshowimage" style="width:800px;height:400px;">
<img src="https://placehold.it/900x450" class="slideshowimage" style="width:800px;height:400px;">
</div>
<div class="buttoncontainer">
</div>
</div>
I have this animation working in Firefox, Chrome, and Safari. I want it to work in IE (IE11 and hopefully 10). Some of this code is IE/MS specific in an attempt to get this work, not all it may be supported by IE. It was an attempt. I would appreciate any pointers towards a solution. Even one that diverges from this or uses javascript (though hopefully doesn't require jquery).
http://jsfiddle.net/raueqe8q/1/
/*Animations*/
#-o-keyframes flipInnerContainer {
0% {
-o-transform: rotateY(0deg);
transform: rotateY(0deg);
}
50% {
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
100% {
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
}
#-ms-keyframes flipInnerContainer {
0% {
-ms-transform: perspective(1000px) rotateY(0deg);
transform: rotateY(0deg);
}
50% {
-ms-transform: perspective(1000px) rotateY(180deg);
transform: rotateY(180deg);
}
100% {
-ms-transform: perspective(1000px) rotateY(180deg);
transform: rotateY(180deg);
}
}
#-moz-keyframes flipInnerContainer {
0% {
-moz-transform: rotateY(0deg);
transform: rotateY(0deg);
}
50% {
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
}
100% {
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
}
}
#-webkit-keyframes flipInnerContainer {
0% {
-webkit-transform: rotateY(0deg);
transform: rotateY(0deg);
}
50% {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
100% {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
}
#keyframes flipInnerContainer {
0% {
transform: perspective(1000px) rotateY(0deg);
}
50% {
transform: perspective(1000px) rotateY(180deg);
}
100% {
transform: perspective(1000px) rotateY(180deg);
}
}
#-o-keyframes flipOuterContainer {
0% {
-o-transform: rotateY(0deg);
transform: rotateY(0deg);
}
25% {
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
100% {
-o-transform: rotateY(180deg);
transform: rotateY(180deg);
}
}
#-ms-keyframes flipOuterContainer {
0% {
-ms-transform: perspective(1000px) rotateY(0deg);
transform: rotateY(0deg);
}
25% {
-ms-transform: perspective(1000px) rotateY(180deg);
transform: rotateY(180deg);
}
100% {
-ms-transform: perspective(1000px) rotateY(180deg);
transform: rotateY(180deg);
}
}
#-moz-keyframes flipOuterContainer {
0% {
-moz-transform: rotateY(0deg);
transform: rotateY(0deg);
}
25% {
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
}
100% {
-moz-transform: rotateY(180deg);
transform: rotateY(180deg);
}
}
#-webkit-keyframes flipOuterContainer {
0% {
-webkit-transform: rotateY(0deg);
transform: rotateY(0deg);
}
25% {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
100% {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
}
#keyframes flipOuterContainer {
0% {
transform: perspective(1000px) rotateY(0deg);
}
25% {
transform: perspective(1000px) rotateY(180deg);
}
100% {
transform: perspective(1000px) rotateY(180deg);
}
}
/* Safari was not keeping its end state so this fixes that and does not adversely effect
other webkit browsers */
#-webkit-keyframes disapear {
0% {
opacity: 1;
}
1% {
opacity: 0;
}
100% {
opacity: 0;
}
}
#-ms-keyframes disapear {
0% {
opacity: 1;
}
1% {
opacity: 0;
}
100% {
opacity: 0;
}
}
#-ms-keyframes appear {
0% {
opacity: 0;
}
1% {
opacity: 1;
}
100% {
opacity: 1;
}
}
/*all*/
.adbox {
margin: 20px;
background: #000000;
position: relative;
z-index: 1;
}
#bg-exit {
background-color: rgba(255, 255, 255, 0);
cursor: pointer;
height: 100%;
left: 0px;
position: absolute;
top: 0px;
width: 100%;
}
.container {
-moz-perspective: 1000px;
-webkit-perspective: 1000px;
perspective: 1000px;
}
.container-one,
.container-two,
.container-three,
.container-four,
.threehundred-one,
.threehundred-two,
.threehundred-three,
.threehundred-four,
.seventwentyeight-one,
.seventwentyeight-two,
.seventwentyeight-three,
.seventwentyeight-four {
position: absolute;
width: 100%;
height: 100%;
-moz-transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.first {
position: absolute;
width: 100%;
height: 100%;
-moz-backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-ms-backface-visibility: visible;
backface-visibility: hidden;
}
.first.firstonly {
-webkit-animation: disapear .5s linear 10s 1 forwards;
}
.first.back {
position: absolute;
-o-transform: rotateY(180deg);
-ms-transform: perspective(1000px) rotateY(180deg);
-moz-transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
box-sizing: border-box;
}
.back {
-ms-animation: appear .5s linear 3.5s 1 forwards;
}
.third {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
box-sizing: border-box;
-moz-backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-ms-backface-visibility: hidden;
backface-visibility: hidden;
-o-transform: rotateY(180deg);
-ms-transform: perspective(1000px) rotateY(180deg);
-moz-transform: rotateY(180deg);
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
.tile {
width: 100%;
height: 100%;
-moz-transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.tile.one {
-moz-animation: flipInnerContainer 2s linear 2s 1 forwards;
-o-animation: flipInnerContainer 2s linear 2s 1 forwards;
-webkit-animation: flipInnerContainer 2s linear 2s 1 forwards;
animation: flipInnerContainer 2s linear 2s 1 forwards;
}
.tile.two {
-moz-animation: flipInnerContainer 2s linear 4s 1 forwards;
-o-animation: flipInnerContainer 2s linear 4s 1 forwards;
-webkit-animation: flipInnerContainer 2s linear 4s 1 forwards;
animation: flipInnerContainer 2s linear 4s 1 forwards;
}
.tile.three {
-moz-animation: flipInnerContainer 2s linear 6s 1 forwards;
-o-animation: flipInnerContainer 2s linear 6s 1 forwards;
-webkit-animation: flipInnerContainer 2s linear 6s 1 forwards;
animation: flipInnerContainer 2s linear 6s 1 forwards;
}
.tile.four {
-moz-animation: flipInnerContainer 2s linear 8s 1 forwards;
-o-animation: flipInnerContainer 2s linear 8s 1 forwards;
-webkit-animation: flipInnerContainer 2s linear 8s 1 forwards;
animation: flipInnerContainer 2s linear 8s 1 forwards;
}
/*160x600*/
.onesixty {
width: 160px;
height: 600px;
}
.onesixty .container {
width: 160px;
height: 150px;
}
.container-one {
-moz-animation: flipOuterContainer 2s linear 11.25s 1 forwards;
-o-animation: flipOuterContainer 2s linear 11.25s 1 forwards;
-webkit-animation: flipOuterContainer 2s linear 11.25s 1 forwards;
animation: flipOuterContainer 2s linear 11.25s 1 forwards;
}
.container-two {
-moz-animation: flipOuterContainer 2s linear 11.75s 1 forwards;
-o-animation: flipOuterContainer 2s linear 11.75s 1 forwards;
-webkit-animation: flipOuterContainer 2s linear 11.75s 1 forwards;
animation: flipOuterContainer 2s linear 11.75s 1 forwards;
}
.container-three {
-moz-animation: flipOuterContainer 2s linear 11s 1 forwards;
-o-animation: flipOuterContainer 2s linear 11s 1 forwards;
-webkit-animation: flipOuterContainer 2s linear 11s 1 forwards;
animation: flipOuterContainer 2s linear 11s 1 forwards;
}
.container-four {
-moz-animation: flipOuterContainer 2s linear 11.5s 1 forwards;
-o-animation: flipOuterContainer 2s linear 11.5s 1 forwards;
-webkit-animation: flipOuterContainer 2s linear 11.5s 1 forwards;
animation: flipOuterContainer 2s linear 11.5s 1 forwards;
}
<section class="onesixty adbox">
<div id="bg-exit">
</div>
<div class="container">
<div class="container-three">
<div class="tile three">
<div class="first firstonly">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/A-1.jpg" height="150px" width="160px">
</div>
<div class="first back">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/A-2.jpg" height="150px" width="160px">
</div>
</div>
<div class="third">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/A-3.jpg" height="150px" width="160px">
</div>
</div>
</div>
<div class="container">
<div class="container-one">
<div class="tile one">
<div class="first firstonly">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/B-1.jpg" height="150px" width="160px">
</div>
<div class="first back">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/B-2.jpg" height="150px" width="160px">
</div>
</div>
<div class="third">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/B-3.jpg" height="150px" width="160px">
</div>
</div>
</div>
<div class="container">
<div class="container-four">
<div class="tile four">
<div class="first firstonly">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/C-1.jpg" height="150px" width="160px">
</div>
<div class="first back">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/C-2.jpg" height="150px" width="160px">
</div>
</div>
<div class="third">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/C-3.jpg" height="150px" width="160px">
</div>
</div>
</div>
<div class="container">
<div class="container-two">
<div class="tile two">
<div class="first firstonly">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/D-1.jpg" height="150px" width="160px">
</div>
<div class="first back">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/D-2.jpg" height="150px" width="160px">
</div>
</div>
<div class="third">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/D-3.jpg" height="150px" width="160px">
</div>
</div>
</div>
</section>
This is pretty different but a solution I got working in IE. This now works in everything by Safari.
The original question's example does work in Safari.
So with the two there is a solution in all modern browsers.
http://jsfiddle.net/0tggmkbf/
<script type="">
function flip1(){
var id='container1';
var myClassName=" flip"; //must keep a space before class name
var d;
d=document.getElementById(id);
d.className=d.className.replace(myClassName,""); // first remove the class name if that already exists
d.className = d.className + myClassName; // adding new class name
}
function flip2(){
var id='container2';
var myClassName=" flip"; //must keep a space before class name
var d;
d=document.getElementById(id);
d.className=d.className.replace(myClassName,""); // first remove the class name if that already exists
d.className = d.className + myClassName; // adding new class name
}
function flip3(){
var id='container3';
var myClassName=" flip"; //must keep a space before class name
var d;
d=document.getElementById(id);
d.className=d.className.replace(myClassName,""); // first remove the class name if that already exists
d.className = d.className + myClassName; // adding new class name
}
function flip4(){
var id='container4';
var myClassName=" flip"; //must keep a space before class name
var d;
d=document.getElementById(id);
d.className=d.className.replace(myClassName,""); // first remove the class name if that already exists
d.className = d.className + myClassName; // adding new class name
}
//My Attempt at the 3rd flip, not working
function finalFlip1(){
var imgElement = document.getElementById('A1'); //find the image
imgElement.src = "http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/B-3.jpg";
var id='container1';
var myClassName=" flip"; //must keep a space before class name
var d;
d=document.getElementById(id);
d.className=d.className.replace(myClassName,"");
}
function finalFlip2(){
var imgElement = document.getElementById('B1'); //find the image
imgElement.src = "http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/D-3.jpg";
var id='container2';
var myClassName=" flip"; //must keep a space before class name
var d;
d=document.getElementById(id);
d.className=d.className.replace(myClassName,"");
}
function finalFlip3(){
var imgElement = document.getElementById('C1'); //find the image
imgElement.src = "http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/A-3.jpg";
var id='container3';
var myClassName=" flip"; //must keep a space before class name
var d;
d=document.getElementById(id);
d.className=d.className.replace(myClassName,"");
}
function finalFlip4(){
var imgElement = document.getElementById('D1'); //find the image
imgElement.src = "http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/C-3.jpg";
var id='container4';
var myClassName=" flip"; //must keep a space before class name
var d;
d=document.getElementById(id);
d.className=d.className.replace(myClassName,"");
}
window.setTimeout(flip1,2000);
window.setTimeout(flip2,4000);
window.setTimeout(flip3,6000);
window.setTimeout(flip4,8000);
window.setTimeout(finalFlip1,11250);
window.setTimeout(finalFlip2,11750);
window.setTimeout(finalFlip3,11000);
window.setTimeout(finalFlip4,11500);
</script>
<style>
/* entire container, keeps perspective */
.container {
perspective: 1000;
transform-style: preserve-3d;
}
/* UPDATED! flip the pane when this class is added */
.container.flip .back {
transform: rotateY(0deg);
}
.container.flip .firstonly {
transform: rotateY(180deg);
}
.container, .firstonly, .back {
width: 160px;
height: 150px;
}
/* flip speed goes here */
.container-one,.container-two,.container-three,.container-four {
transition: 0.6s;
transform-style: preserve-3d;
position: relative;
}
/* hide back of pane during swap */
.firstonly, .back {
backface-visibility: hidden;
transition: 0.6s;
transform-style: preserve-3d;
position: absolute;
top: 0;
left: 0;
}
/* UPDATED! firstonly pane, placed above back */
.firstonly {
z-index: 2;
transform: rotateY(0deg);
}
/* back, initially hidden pane */
.back {
transform: rotateY(-180deg);
}
.third{
display:none;
}
</style>
<section class="onesixty adbox">
<div id="bg-exit"></div>
<div class="container" id="container3">
<div class="container-three">
<div class="tile three">
<div class="first firstonly">
<img id="C1" src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/A-1.jpg" height="150px" width="160px" />
</div>
<div class="first back">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/A-2.jpg" height="150px" width="160px">
</div>
</div>
</div>
</div>
<div class="container" id="container1">
<div class="container-one">
<div class="tile one">
<div class="first firstonly">
<img id="A1" src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/B-1.jpg" height="150px" width="160px">
</div>
<div class="first back">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/B-2.jpg" height="150px" width="160px">
</div>
</div>
</div>
</div>
<div class="container" id="container4">
<div class="container-four">
<div class="tile four">
<div class="first firstonly">
<img ID ="D1" src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/C-1.jpg" height="150px" width="160px">
</div>
<div class="first back">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/C-2.jpg" height="150px" width="160px">
</div>
</div>
</div>
</div>
<div class="container" id="container2">
<div class="container-two">
<div class="tile two">
<div class="first firstonly">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/D-1.jpg" height="150px" width="160px" ID="B1">
</div>
<div class="first back">
<img src="http://www.highfivefriday.com/sites/www.highfivefriday.com/files/cssAnimationDemo/D-2.jpg" height="150px" width="160px">
</div>
</div>
</div>
</div>
</section>
I'm relatively new to CSS. I saw a lot of similar topics but I couldn't find a solution to this problem so I'll ask away.
I'm trying to create a photobanner with a keyframe animation where the images scroll to the left and scale with img:hover. The translation transform works fine and the scale transform works fine however, the latter only works if I remove the css for the keyframe animation. How can I get both transformation to work at the same time?
My CSS is as follows:
.photobannerContainer {
margin: 0 auto;
width: 90%;
overflow: hidden;
}
.photobanner {
height: 480px;
width: 8000px; /* To contain all the images end-to-end. */
}
.photobanner img {
height:100%;
transition: all .2s ease;
/*If I remove these lines then the scale transformation will work.*/
-webkit-animation: bannermove 30s linear infinite;
-moz-animation: bannermove 30s linear infinite;
-ms-animation: bannermove 30s linear infinite;
-o-animation: bannermove 30s linear infinite;
animation: bannermove 30s linear infinite;
}
.photobanner img:hover {
transform: scale(1.1);
-ms-transform: scale(1.1);
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-o-transform: scale(1.1);
}
#keyframes bannermove {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-3726px);
}
}
#-moz-keyframes bannermove {
0% {
-moz-transform: translateX(0);
}
100% {
-moz-transform: translateX(-3726px);
}
}
#-webkit-keyframes bannermove {
0% {
-webkit-transform: translateX(0);
}
100% {
-webkit-transform: translateX(-3726px);
}
}
#-ms-keyframes bannermove {
0% {
-ms-transform: translateX(0);
}
100% {
-ms-transform: translateX(-3726px);
}
}
#-o-keyframes bannermove {
0% {
-o-transform: translateX(0);
}
100% {
-o-transform: translateX(-3726px);
}
}
The HTML is set up as follows:
<div class="photobannerContainer">
<div class="photobanner">
<img src="url"/>
<img src="url"/>
<img src="url"/>
<img src="url"/>
<img src="url"/>
<img src="url"/>
<img src="url"/>
<img src="url"/>
<img src="url"/>
</div>
</div>
Thank you.
i have the problem today,and i dont know the reason too,but i solved it by add a extra div tag out side animation-div tag,and put transition in the outside div
like:
html
<div class="extra-div">
<div class="animation-div">
</div>
</div>
CSS
.extra-div{
transition: all .2s ease;
}
.extra-div:hover{
transform: scale(1.9);
}
.animation-div {
animation: myAnime 0.2s ease-out
}