ʱ¹âתÑÛ¼´ÊÅ£¬ÓÖµ½ÖÜÁùÁË£¬½ñÌìдµãij²¿·ÖÈË¿´²»ÆðµÄcssÍæÍ棡
ת»» ת»»ÊôÐÔtransform:ä¯ÀÀÆ÷ǰ׺:
-webkit-transform;-o-transform;-moz-transform;-ms-transform;
È¡Öµ£º
none : ĬÈÏÖµ£¬Ã»ÓÐת»»²Ù×÷
transform-function:Ò»×éת»»º¯Êý
transform:º¯Êý1() º¯Êý2() ......;
ÔÚ²»Ö¸¶¨ÔµãÇ°ÌáÇ°£¬Ä¬ÈÏÔµãΪԪËصÄÖÐÐÄ´¦
È¡Öµ£ºÊýÖµ/°Ù·Ö±È/¹Ø¼ü×Ö
Ò»¸öÖµ£ºËùÓÐÖáλÖÃ
Á½¸öÖµ£º±íʾxÖáºÍyÖá
Èý¸öÖµ£º±íʾxÖᣬyÖᣬzÖá
º¯Êý:translate()
È¡Öµ£º
translate(x) : Ö»×öxÖá(ºáÏò)Òƶ¯
translate(x,y) : ×öxÖáºÍyÖáµÄÒƶ¯
·½Ïò£º¿´·ûºÅ
+ ÏòÓÒ¡¢ÏòÏÂ
- Ïò×ó¡¢ÏòÉÏ
×¢Ò⣺
È¡Öµ¿ÉÒÔΪÊýÖµ»ò°Ù·Ö±È¡¢¸ºÊý
µ¥ÏòλÒƺ¯Êý:
translateX(x) : Ö»×öxÖáÒƶ¯
translateY(y) : Ö»×öyÖáÒƶ¯
¸Ä±äÔªËصijߴç
º¯Êý:scale()
È¡Öµ£º
1¸öÖµ£º±íʾµÚÒ»¸öÖµºÍµÚ¶þ¸öÖµÊÇÏàµÈµÄ
2¸öÖµ£ºµÚÒ»¸ö x µÚ¶þ¸ö y
µ¥ÏòËõ·Åº¯Êý£º
scaleX(x),scaleY(y)
È¡Öµ:
ĬÈÏÖµ Ϊ1
ËõС£º0-1Ö®¼äµÄСÊý
·Å´ó£º´óÓÚ1µÄÊýÖµ
º¯Êý£ºrotate()
È¡Öµ£ºrotate(ndeg)
n : ¾ßÌå½Ç¶ÈÖµ
nΪÕý£¬ Ôò˳ʱÕëÐýת
nΪ¸º£¬ ÔòÄæʱÕëÐýת
º¯Êý£ºskew()
skewx() --xÖáÇãб
skewy() --yÖáÇãб
×÷ÓãºÖ¸¶¨ÔªËØÔÚÄÄЩcssÊôÐÔÉϵı仯»á²úÉú¹ý¶ÉµÄЧ¹û£¨±ØÐëµÄ£©
ÊôÐÔ£ºtransition-property
È¡Öµ£ºnone | all | property
eg:transition-property:background;
eg:transition-property:background,width,height;
×÷ÓãºÖ¸¶¨¹ý¶ÉЧ¹ûÔڶ೤ʱ¼äÄÚÍê³É¡£
×¢Ò⣺¿ÉÒÔÒÔ s | ms Ϊµ¥Î».¸ÃÊôÐÔ²»ÄÜÊ¡ÂÔ£¬Ò»µ©Ê¡ÂÔÔòûÓйý¶ÉЧ¹û
ÊôÐÔ£ºtransition-duration
È¡Öµ£ºs|ms
eg:transition-duration:5s;
eg:transition-duration:5s,1s,1s;
×÷Ó㺶¨ÒåÕû¸ö¹ý¶ÉЧ¹ûµÄËÙÂÊ¡£±ÈÈç ÏÈ¿ìºóÂý£¬»¹ÊÇ ÏÈÂýºó¿ì£¬»òÕß»¹ÊÇÔÈËÙ
ÊôÐÔ:transition-timing-function
È¡Öµ£ºÔ¤¶¨ÒåÖµ»ò±´Èû¶ûÇúÏß
ease : ĬÈÏÖµ£¬ÂýËÙ¿ªÊ¼£¬¿ìËÙ±ä¿ì£¬ÒÔÂýËÙ½áÊø
linear:ÔÈËÙ
ease-in£ºÂýËÙ¿ªÊ¼£¬¼ÓËÙЧ¹û
ease-out:ÂýËÙ½áÊø(¿ìËÙ¿ªÊ¼),¼õËÙЧ¹û
ease-in-out:ÂýËÙ¿ªÊ¼ºÍ½áÊø£¬ÖмäÏȼӺó¼õ
eg:transition-timing-function:linear;
×÷Ó㺼¤·¢¹ý¶É²Ù×÷ºó£¬µÈ´ý¶à³¤Ê±¼äºó²Å¿ªÊ¼Ö´Ðйý¶ÉЧ¹û
ÊôÐÔ:transition-delay
È¡Öµ£ºÒÔ s | msΪµ¥Î»µÄʱ¼ä
eg:transition-delay:5s;
ÊôÐÔ£ºtransition
È¡Öµ£ºÒÔ¿Õ¸ñ·Ö¿ªµÄÖµÁбí
property duration timing-function delay;
eg:transition:background 1s linear 0s;
transition:background 1s;
¶à¸ö¹ý¶ÉЧ¹û:
transition : background 1s linear 0s,
color 2s linear 0s,
border-radius 3s linear 1s;
¶¯»µÄÏêϸ²ÎÊýÈ¥¿´w3c°É£¡
ÕâÀï¾ÍÌáÏÂ×¢ÒâµÄµØ·½£º
@keyframesÓï·¨£º£¨µ¥¶Àд£¬ÔÚÑ¡ÔñÆ÷Í⣬styleÄÚ£© @keyframes name{ from {cssÑùʽ£»} percent{cssÑùʽ£»} to {cssÑùʽ£»} } animationÓï·¨£º£¨Ð´ÔÚÑ¡ÔñÆ÷ÄÚ£© animation£ºname duration timing-function delay iteration-count direction£»
animation-fill-mode£¨ie10+£©ÊôÐԹ涨¶¯»ÔÚ²¥·Å֮ǰ»òÖ®ºó£¬Æ䶯»Ð§¹ûÊÇ·ñ¿É¼û¡£
none --²»¸Ä±äĬÈÏÐÐΪ¡£
forwards-- µ±¶¯»Íê³Éºó£¬±£³Ö×îºóÒ»¸öÊôÐÔÖµ£¨ÔÚ×îºóÒ»¸ö¹Ø¼üÖ¡Öж¨Ò壩¡£
backwards --ÔÚ animation-delay ËùÖ¸¶¨µÄÒ»¶Îʱ¼äÄÚ£¬ÔÚ¶¯»ÏÔʾ֮ǰ£¬Ó¦ÓÿªÊ¼ÊôÐÔÖµ £¨ÔÚµÚÒ»¸ö¹Ø¼üÖ¡Öж¨Ò壩¡£
both --ÏòÇ°ºÍÏòºóÌî³äģʽ¶¼±»Ó¦Óá£
˵µÄÒ²²î²»¶àÁË£¬Ö±½ÓÉÏ´úÂ룡
¡¡