csså¨ç»
ä¸ãtransitionå¨ç»
1ï¼transition-property:æçæ¯éè¦ååçå±æ§,
ï¼1ï¼ï¼å±æ§å¼å¯ä»¥æ¯ä¸ä¸ªæè å¤ä¸ª
ï¼2ï¼ï¼allï¼ææåçååçå±æ§ï¼
2ï¼transition-durationï¼æ§è¡å¨ç»æ¶é¿
3ï¼transition-timing-function: linear(åé);å¨ç»æ§è¡æ¹å¼
linearï¼çº¿æ§ï¼åé
easeï¼æ ¢å¼å§å¿«è¿ç¨æ ¢ç»æï¼æ ¢å¿«æ ¢ï¼
ease-inï¼å·²æ ¢å¼å§
ease-outï¼å·²æ ¢ç»æ
ease-in-outï¼å³æ ¢è¦å¿«ç»æï¼ä¸å¸¸ç¨ï¼
4ï¼transition-delay:延è¿æ¶é´
ç®åæ¹å¼ï¼transitionï¼ååå±æ§ å¨ç»æ¶é¿ æ§è¡æ¹å¼ 延è¿æ¶é´
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>transition</title>
<style>
.transition {
width: 100px;
height: 100px;
background: red;
transition:all 2s linear;
}
.transition:hover{
margin: 100px;
}
</style>
</head>
<body>
<div class="transition"></div>
</body>
</html>
äºãanimation:å¨ç»
1ï¼animation-name:å称 @keyframesåé¢æ对åºçå称
2ï¼animation-duration:å¨ç»æ¶é¿
3ï¼animation-timing-function:æ§è¡æ¹å¼
linearï¼åé
ease ï¼ä»¥æ ¢å¼å§,ä»¥æ ¢ç»æ
ease-inï¼ä»¥æ ¢å¼å§
ease-outï¼ä»¥æ ¢ç»æ
ease-in-outï¼å³æ ¢è¦å¿«ç»æï¼ä¸å¸¸ç¨)
4ï¼animation-delayï¼å»¶è¿æ¶é´
5ï¼animation-iteration-countï¼å¨ç»éå¤æ¬¡æ°
aï¼å±æ§å¼å¯ä»¥ç´æ¥æ¯æ°å
bï¼infiniteï¼æ é次循ç¯
6ï¼animation-direction å¨ç»å¾ªç¯æ§è¡æ¹å¼
aï¼ alternate æ¥åæ§è¡
bï¼normal é»è®¤æ¹å¼
ç®åæ¹å¼ï¼animationï¼name å¨ç»æ¶é¿ å¨ç»æ§è¡æ¹å¼ 延è¿æ¶é´ æ¬¡æ° å¾ªç¯æ¹å¼
@keyframes:å®å¶åå(å±æ§)
æ¹å¼ä¸ï¼
from:åå§æ ·å¼
to:æ¹ååæ ·å¼
æ¹å¼äºï¼ç¾åæ¯
egï¼0%{} 50%{} 100%{}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>amination </title>
<style>
.amination {
width: 100px;
height: 100px;
background: red;
animation: auto 5s linear infinite alternate;
}
@keyframes auto {
0% {
width: 200px;
}
10% {
width: 300px;
}
20% {
width: 400px;
}
}
</style>
</head>
<body>
<div class="amination"></div>
</body>
</html>
* transition éè¦äºä»¶æè½è§¦å 触åæ§è¡(ä¸è½è®¾ç½®å¾ªç¯æ¬¡æ°)
* animation å¯ä»¥ç«å³æ§è¡å¨ç» å¯ä»¥è®¾ç½®å¾ªç¯æ¬¡æ°
上一篇: python 基础 网络爬虫 day03
下一篇: Android 动画总结