。あるイベントで親要素のクラスをトリガし、このクラスが適用されたときにのみアニメーションが発生するように設定することができます。デモンストレーションのための簡単なスニペットを作った。これがあなたの場合の仕事をするかどうかは分かりません。
@keyframes circle {
from { transform:rotate(0deg); }
to { transform:rotate(360deg); }
}
@keyframes inner-circle {
from { transform:rotate(0deg); }
to { transform:rotate(-360deg); }
}
.wrapper {
position: relative;
width: 400px;
height: 400px;
background-color: #CCCCCC;
border-radius: 50%;
font-size:12px;
animation: circle 5s linear infinite;
}
img {
width: 75px;
height: 75px;
}
.div1 {
position: absolute;
width:100px;
height:100px;
margin: 20px auto 0;
transform-origin:50% 50%;
}
.div2 {
position: absolute;
width:100px;
height:100px;
margin: 275px auto 0;
color:red;
transform-origin:50% 50%;
}
.div3 {
width:100px;
height:100px;
margin: 20px auto 0;
color:blue;
transform-origin:50% 200px;
}
.div4 {
width:100px;
height:100px;
margin: 20px auto 0;
color:green;
transform-origin:50% 200px;
}
div > div {
animation: inner-circle 5s linear infinite;
}
<div class="wrapper">
<div class="div1">
<img src="https://cdn0.iconfinder.com/data/icons/star-wars/512/darth_vader-128.png" />
<p>
This is some text lorem
</p>
</div>
<div class="div2">
<img src="https://cdn0.iconfinder.com/data/icons/star-wars/512/darth_vader-128.png" />
<p>
This is some text lorem
</p>
</div>
</div>
素子全体を時計回りに回転させ、同じ時間で、内側要素反時計回りに回転します。 –
は完璧に機能します。ありがとう! – CaKa