Denoteone
Denoteone

Reputation: 4055

Simple CSS3 animation not running in IE 11

I have an example of a basic circle loader animation that will not start in IE 11 but runs smooth it just about every other browser

Code:

.circular-still {
  height: 150px;
  -webkit-transform-origin: center center;
  transform-origin: center center;
  width: 150px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}
.path {
  -webkit-animation: dash 1.5s ease-in-out infinite;
  animation: dash 1.5s ease-in-out infinite;
  stroke: #c0c0c0;
  stroke-linecap: round;
  stroke-dasharray: 89, 200;
  stroke-dashoffset: -124px;
}
@-webkit-keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}
@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}
<div id="loader" style="display: block;">
  <svg class="circular-still" viewBox="25 25 50 50">
    <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="4" stroke-miterlimit="5" />
  </svg>
</div>

Below is an example if opened in any browser but IE 11 you should get an animated circle but just a dot in IE11

https://jsfiddle.net/3orv8rjz/

Upvotes: 2

Views: 1490

Answers (1)

Marvin
Marvin

Reputation: 10092

I found this on a similar question (Source):

Only Microsoft Edge will support SVG CSS Transitions and Animation.. especially stroke-dasharray.

Please see the Microsoft Developer Docs: https://dev.windows.com/en-us/microsoft-edge/platform/status/csstransitionsanimationsforsvgelements

Tested in Edge, it only works when setting the units:

0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0px; /* px required */
}

Upvotes: 3

Related Questions