Tôi đã tạo hoạt ảnh cho SVG bằng css3 đang hoạt động hoàn hảo trong Chrome và Firefox. Nó là một phần hoạt động trong Safari, nhưng không làm việc trong Internet Explorer (IE9 + có hỗ trợ hình ảnh động css)Hoạt ảnh CSS3 không hoạt động
CSS:
@-webkit-keyframes dash {
70%,80% {
stroke-dashoffset: 0;
fill-opacity: 0;
}
85% {
fill-opacity: 0;
stroke-opacity: 1;
}
95% {
stroke: #17739D;
stroke-dashoffset: -301;
stroke-opacity: 0;
}
100% {
fill-opacity: 1;
stroke-dashoffset: -301;
}
}
@-ms-keyframes dash {
70%,80% {
stroke-dashoffset: 0;
fill-opacity: 0;
}
85% {
fill-opacity: 0;
stroke-opacity: 1;
}
95% {
stroke: #17739D;
stroke-dashoffset: -301;
stroke-opacity: 0;
}
100% {
fill-opacity: 1;
stroke-dashoffset: -301;
}
}
@-moz-keyframes dash {
70%,80% {
stroke-dashoffset: 0;
fill-opacity: 0;
}
85% {
fill-opacity: 0;
stroke-opacity: 1;
}
95% {
stroke: #17739D;
stroke-dashoffset: -301;
stroke-opacity: 0;
}
100% {
fill-opacity: 1;
stroke-dashoffset: -301;
}
}
@keyframes dash {
70%,80% {
stroke-dashoffset: 0;
fill-opacity: 0;
}
85% {
fill-opacity: 0;
stroke-opacity: 1;
}
95% {
stroke: #17739D;
stroke-dashoffset: -301;
stroke-opacity: 0;
}
100% {
fill-opacity: 1;
stroke-dashoffset: -301;
}
}
#Layer_1 {
margin-left: auto;
margin-right : auto;
top: 50%;
position: absolute;
left: 50%;
margin-left: -65px;
margin-top: -35px;
}
svg {
background: #fff;
display: block;
}
svg * {
stroke: #666;
#stroke: #17739D;
stroke-width: 1;
fill-opacity: 0;
stroke-dasharray: 350;
stroke-dashoffset: 440;
}
svg #bp_svg * {
-webkit-animation-name : dash;
-moz-animation-name : dash;
-ms-animation-name : dash;
animation-name : dash;
-webkit-animation-duration: 4s;
-moz-animation-duration: 4s;
-ms-animation-duration: 4s;
animation-duration: 4s;
-webkit-animation-timing-function : linear;
-moz-animation-timing-function : linear;
-ms-animation-timing-function : linear;
animation-timing-function : linear;
-webkit-animation-fill-mode : forwards;
-moz-animation-fill-mode : forwards;
-ms-animation-fill-mode : forwards;
animation-fill-mode : forwards;
}
bất cứ ai có thể giúp tôi để sắp xếp ra phải làm gì để làm cho nó hoạt động đúng trong Safari và IE?
Tôi không biết mã của bạn có gì sai hoặc nếu thông tin này hữu ích cho bạn, nhưng sau một giờ bẻ mã của bạn, ** Tôi có thể hiển thị nó mà không có hoạt ảnh trong IE **. Tôi đã thay đổi 'fill-opacity' trong khối CSS' svg * '. Kiểm tra này [fiddle] (http://jsfiddle.net/c87vY/4/) – Rohith
Điều này có vẻ như một dự phòng lý tưởng như các hình ảnh động là đóng băng và bạn thực sự chỉ cần nhìn thấy chiếc bánh. – misterManSam
+1 vì hoạt ảnh thú vị :) –