效果:
代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
<style>
svg:not(:root) {
overflow: hidden;
}
#load-circle {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 10rem;
animation: loading 3s linear infinite;
}
#load-circle #loading-inner {
stroke-dashoffset: 0;
stroke-dasharray: 300;
stroke-width: 10;
stroke-miterlimit: 10;
stroke-linecap: round;
animation: loading-circle 2s linear infinite;
stroke: #51BBA7;
fill: transparent;
}
@keyframes loading {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
@keyframes loading-circle {
0% {
stroke-dashoffset: 0;
}
100% {
stroke-dashoffset: -600;
}
}
</style>
</head>
<body>
<svg id="load-circle" x="0px" y="0px" viewBox="0 0 150 150">
<circle id="loading-inner" cx="75" cy="75" r="60"/>
</svg>
</body>
</html>