动画对角线查询

我想知道是否有人知道如何使用jquery创建对角线并为其设置动画,以便当它看起来被绘制而不是仅仅出现时?

圆圈也需要相同。

一个简单的jsfiddle将是很棒的。

很多人的帮助!!

你可以用纯CSS实现它:

演示

对角线

HTML

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

 

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); } }