0

I've come across this post// Slide out text from an image using CSS on hover

The CSS works perfectly, except I would like for the animation to stop after it's rotated once.

Is this possible? If so how can I accomplish this?

HTML:

@-webkit-keyframes rotate {
    from {
        -webkit-transform: rotate(180deg);
    }
    to { 
        -webkit-transform: rotate(0deg);
    }
}

@-moz-keyframes rotate {
    from {
      -moz-transform: rotate(180deg);
    }
    to { 
        -moz-transform: rotate(0deg);
    }
}

.srch_btn:hover {   
    -webkit-animation-name:            rotate; 
    -webkit-animation-duration:        0.5s; 
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-timing-function: linear;

    -moz-animation-name:            rotate; 
    -moz-animation-duration:        0.5s; 
    -moz-animation-iteration-count: infinite;
    -moz-animation-timing-function: linear;
}
random_user_name
  • 25,694
  • 7
  • 76
  • 115
KXXT
  • 251
  • 2
  • 4
  • 20

1 Answers1

2

Change animation-iteration-count: infinite to 2.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964