我想知道是否有人知道如何使用 jquery 创建对 Angular 线并对其进行动画处理,以便当它出现时它被绘制而不是仅仅出现?
也需要同样的圆。
一个简单的 jsfiddle 会很棒。
非常需要帮助!!
最佳答案
您实际上可以使用纯 CSS 来完成:
demo
对 Angular 线
HTML:
<div class='box'></div>
CSS:
.box {
overflow: hidden;
outline: dotted 1px;
width: 8.09em; height: 5.88em;
background: linear-gradient(36deg,
transparent 49.5%, black 49.5%, black 50.5%, transparent 50.5%)
no-repeat -8.09em -5.88em;
background-size: 100% 100%;
animation: drawDiag 2s linear forwards;
}
@keyframes drawDiag {
to { background-position: 0 0; }
}
圈子
HTML:
<div class='circle'>
<div class='cover'></div>
</div>
CSS:
.circle {
overflow: hidden;
position: relative;
width: 10em; height: 10em;
}
.circle:before {
position: absolute;
width: inherit; height: inherit;
border-radius: 50%;
box-shadow: inset 0 0 0 1px black;
content: '';
}
.cover {
position: absolute;
margin: 0 -50%;
width: 200%; height: inherit;
transform-origin: 50% 0;
background: white;
animation: revealCircle 5s linear forwards;
}
@keyframes revealCircle {
to { transform: rotate(180deg); }
}
关于jquery - 动画对 Angular 线查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15555186/