css3 틈새 없이 굴러가는 윤방도 실현
20047 단어 프런트엔드 소규모 사례
효과도
css3 애니메이션 지식 응용
@keyframes moveTest {
0% {
transform: translate(100px);
}
50% {
transform: translate(100px, 200px);
}
100% {
transform: translate(200px, 400px);
}
}
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titletitle>
<style>
.window{
width:1000px;
height:138px;
border:1px solid #eeeeee;
margin:100px auto;
overflow: hidden;
}
.images_list{
width:2000px;
height:138px;
animation-name: move;
animation-duration: 4s;
animation-timing-function: linear;
animation-iteration-count: infinite;
}
img {
float: left;
width: 100px;
height: 138px;
}
.images_list:hover{
cursor:pointer;
animation-play-state: paused;
}
@keyframes move{
from{
transform:translate(0px);
}
to{
transform:translate(-1000px);
}
}
style>
head>
<body>
<div class="window">
<div class="images_list">
<img src="./public/images/pk1.jpg" alt="">
<img src="./public/images/pk2.jpg" alt="">
<img src="./public/images/pk3.jpg" alt="">
<img src="./public/images/pk4.jpg" alt="">
<img src="./public/images/pk5.jpg" alt="">
<img src="./public/images/pk6.jpg" alt="">
<img src="./public/images/pk7.jpg" alt="">
<img src="./public/images/pk8.jpg" alt="">
<img src="./public/images/pk9.jpg" alt="">
<img src="./public/images/pk10.jpg" alt="">
<img src="./public/images/pk1.jpg" alt="">
<img src="./public/images/pk2.jpg" alt="">
<img src="./public/images/pk3.jpg" alt="">
<img src="./public/images/pk4.jpg" alt="">
<img src="./public/images/pk5.jpg" alt="">
<img src="./public/images/pk6.jpg" alt="">
<img src="./public/images/pk7.jpg" alt="">
<img src="./public/images/pk8.jpg" alt="">
<img src="./public/images/pk9.jpg" alt="">
<img src="./public/images/pk10.jpg" alt="">
div>
div>
body>
html>