fadInアニメーションを更新時に読みこむようにしたいのですが、マウスオーバー時にもかかってしまって困っています。
<li class="works fadeIn"> <a href="#"> <span>works</span> </a> </li>
.works { position: absolute; top: 20%; left: 24%; transform: translateY(-50%) translateX(-50%); background-image: url(../img/workpict.png); background-size:auto 40%; background-repeat: no-repeat; background-position: top 10rem left 50% ; /*background-color:rgba(255,255,255,1);*/ background-blend-mode:lighten; animation-delay: 0.5s; } .works a:hover span { animation-name: slidetop; animation-duration: 1.5s; animation-fill-mode: both; } @keyframes slidetop { 0% { opacity: 1; } 100% { opacity: 0; transform: translateX(50%); } } .works:hover { animation-name: slidebottom; animation-duration: 0.8s; animation-fill-mode: both; } @keyframes slidebottom { 0% { background-position: top 10rem left 50%; /*background-color:rgba(255,255,255,1.0);*/ background-size:auto 70%; } 30% { background-position: top 10rem left 50%; /*background-color:rgba(255,255,255,1.0);*/ background-size:auto 70%; } 41% { /*background-color:rgba(255,255,255,1.0);*/ } 100% { background-position: top 40% left 50%; /*background-color:rgba(255,255,255,0);*/ background-size:auto 70%; } } .fadeIn { animation-name: fadeIn; animation-fill-mode: both; animation-duration: 1s; } @keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
回答1件
あなたの回答
tips
プレビュー