2

jqueryを使用して対角線を作成し、それをアニメーション化して、表示されるだけでなく描画されるようにする方法を誰かが知っているかどうか疑問に思っていましたか?

サークルにも同じことが必要です。

シンプルな jsfiddle は素晴らしいでしょう。

助けてくれたムチョス!!

4

1 に答える 1

1

あなたは実際に純粋なCSSでそれを行うことができます:

デモ

対角線

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); }
}
于 2013-03-21T20:41:31.140 に答える