Skip to content Skip to sidebar Skip to footer

Jquery Toggleclass To Rotate 180° Doesn't Work

I'm trying to make an image ( img tag ) rotate 180° when it's clicked. So at first the 'flip' class was added and removed on click. Then I removed the argument ' e ' in the funct

Solution 1:

If I understood your problem correctly. Here is the solution http://jsfiddle.net/xpvt214o/924105/

try this css

.flip {
  animation: animate 4s ease-in-out;
  transform: rotate(180deg);
  -webkit-transform: rotate(180deg);
}

@keyframes animate{
  0%{
    transform: rotate(0deg)
  }
  100%{
    transform: rotate(180deg)
  }
}

Also in your above code the argument 'e' does not have any functionality. So, removing the argument won't have any effect.

Post a Comment for "Jquery Toggleclass To Rotate 180° Doesn't Work"