Javascript & JQuery & CSS > transition - transition-property, transition-duration, transition-delay µî·ÏÀÏ : 2017-07-14 17:43 Á¶È¸¼ö : 53,211¿À´ÃÀº transition ¼Ó¼º¿¡ ´ëÇؼ ¾Ë¾Æ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.
¸Þ´º·Î »ç¿ëÇÒ À̹ÌÁö°¡ Á¸ÀçÇÕ´Ï´Ù. À§¿Í °°ÀÌ¿ä.... ¸¶¿ì½º¸¦ ¿Ã¸° °æ¿ì background-position È¿°ú¸¦ ÀÌ¿ëÇؼ ƯÁ¤À§Ä¡ÀÇ À̹ÌÁöºÎºÐÀ» º¸¿©ÁÝ´Ï´Ù. ¾Æ·¡¿Í °°ÀÌ¿ä.... background-position ¼Ó¼º¿¡ ´ëÇؼ´Â 14. CSS ¿¹Á¦ - Backgound Ç¥Çö ¿¹Á¦ ¿¡¼ °øºÎÇØ º¸½Ã±â ¹Ù¶ø´Ï´Ù. ±×·¯³ª ¸¶¿ì½º¸¦ ¿Ã·ÈÀ» °æ¿ì ºÎµå·¯¿î È¿°ú¸¦ ÁÖ°í ½ÍÀ» °æ¿ì¿¡´Â transition ¼Ó¼ºÀ» ÀÌÇØ ÇÏ¸é µË´Ï´Ù.
À§¿Í °°Àº ¼Ó¼ºÀ» ÁÖ¸é µË´Ï´Ù. À̹ø Àå¿¡¼´Â ÀÌ transsition ¼Ó¼ºÀÇ ¿É¼Çµé¿¡ ´ëÇؼ Á¤¸®ÇØ º¸°íÀÚ ÇÕ´Ï´Ù. ¸ÕÀú transition È¿°ú´Â ÀͽºÇ÷η¯ 9 ¹öÁ¯ ÀÌÇÏ¿¡¼´Â ÀÛµ¿ÇÏÁö ¾Ê½À´Ï´Ù. transition-property transition-duration transition-timing-function transition-delay transitionÀº À§ 4°¡Áö ¼Ó¼ºÀÇ Ãà¾à ¼Ó¼º(shorthand property)ÀÌ´Ù. ¿µ¾î·Î shorthand property ¶ó°í ÁöĪÇÏ´Ï, ÇÔÃà¼Ó¼º, ¶Ç´Â ´ëÇ¥¼Ó¼ºÀ̶ó°íµµ Ç¥ÇöÇÒ ¼ö ÀÖÀ» °ÍÀÌ´Ù. ½±°Ô ¸»Çϸé, transition Çϳª·Î À§ 4°¡Áö¸¦ ´Ù Ç¥ÇöÇÒ ¼ö ÀÖ´Ù´Â ¾ê±â´Ù. transition-property:width; transition-duration: 1s; transition-timing-function: ease; transition-delay: .5s; transition: width 1s ease .5s; Áï À§ 2°¡ÁöÀÇ »ç¿ë¹ýÀº µ¿ÀÏÇÑ °ÍÀÔ´Ï´Ù. 1. transition-property transition ±¸¹®ÀÇ Ã¹¹ø° ÀÚ¸®¿¡ ¿À´Â transition-property ´Â ¾î¶² ¼Ó¼º¿¡ transition È¿°ú¸¦ ÁÙÁö¸¦ ¼³Á¤ÇÑ´Ù. transition-propertyÀÇ °ª(value) - none : transition È¿°ú¸¦ ÁöÁ¤ÇÏÁö ¾Ê´Â´Ù. - all : ¸ðµç ¼Ó¼ºÀÌ transition È¿°ú¸¦ ¾ò´Â´Ù. - property : transition È¿°ú¸¦ ¾ò°ÔµÉ ¼Ó¼ºÀ» ÁöÁ¤ÇÑ´Ù. ¸ðµç(all) ¼Ó¼ºÀ» ÁöÁ¤ÇÏ´Â °Í°ú ÀϺΠ¼Ó¼ºÀ» ÁöÁ¤ÇÏ´Â °ÍÀº ´ÙÀ½°ú °°Àº Â÷ÀÌ°¡ ÀÖ´Ù. º¹¼öÀÇ ¼Ó¼ºÀ» ÁöÁ¤ÇÒ ¶§´Â ÄÞ¸¶·Î ±¸ºÐÇÏ¿© °¢°¢ÀÇ °ªÀ» ¼³Á¤ ÇÒ ¼ö ÀÖ´Ù. .transitionpost3 { width: 100px; height: 50px; background-color:#8FBC8F; border:1px solid black; transition:width 1s ease, background-color 13s ease; } .transitionpost3:hover { width: 300px; height: 100px; background-color:#000000; } À§ÀÇ /> 1. transition-property transition ±¸¹®ÀÇ Ã¹¹ø° ÀÚ¸®¿¡ ¿À´Â transition-property ´Â ¾î¶² ¼Ó¼º¿¡ transition È¿°ú¸¦ ÁÙÁö¸¦ ¼³Á¤ÇÑ´Ù. transition-propertyÀÇ °ª(value) - none : transition È¿°ú¸¦ ÁöÁ¤ÇÏÁö ¾Ê´Â´Ù. - all : ¸ðµç ¼Ó¼ºÀÌ transition È¿°ú¸¦ ¾ò´Â´Ù. - property : transition È¿°ú¸¦ ¾ò°ÔµÉ ¼Ó¼ºÀ» ÁöÁ¤ÇÑ´Ù. ¸ðµç(all) ¼Ó¼ºÀ» ÁöÁ¤ÇÏ´Â °Í°ú ÀϺΠ¼Ó¼ºÀ» ÁöÁ¤ÇÏ´Â °ÍÀº ´ÙÀ½°ú °°Àº Â÷ÀÌ°¡ ÀÖ´Ù. º¹¼öÀÇ ¼Ó¼ºÀ» ÁöÁ¤ÇÒ ¶§´Â ÄÞ¸¶·Î ±¸ºÐÇÏ¿© °¢°¢ÀÇ °ªÀ» ¼³Á¤ ÇÒ ¼ö ÀÖ´Ù. .transitionpost3 { width: 100px; height: 50px; background-color:#8FBC8F; border:1px solid black; transition:width 1s ease, background-color 13s ease; } .transitionpost3:hover { width: 300px; height: 100px; background-color:#000000; } À§ÀÇ style ¿¹Á¦´Â transition:width 1s ease, background-color 5s ease; ³Êºñ º¯È´Â 1ÃÊ, ¹è°æ»ö»ó º¯È´Â 5ÃÊ¿¡ °ÉÃÄ ÀϾÙ. ±×·¯³ª height ¼Ó¼ºÀº transition ¼Ó¼ºÀ» ÁÖÁö ¾Ê¾Ò±â ¶§¹®¿¡ °ð¹Ù·Î Àû¿ëÀÌ µÈ´Ù. 2. transition-duration transition ±¸¹®ÀÇ µÎ¹ø° ÀÚ¸®¿¡ ¿À´Â transition-durationÀº º¯È°¡ ¸îÃÊ, ¶Ç´Â ¸î ¹Ð¸®¼¼ÄÁµå(1/1000ÃÊ)¿¡ °ÉÃÄ ÀϾÁö¸¦ ¼³Á¤ÇÑ´Ù. 6s, 0.5s, .3s, 120ms À̶ó°í ÀûÇô ÀÖ´Ù¸é, ÀÌ´Â °¢°¢ 6ÃÊ, 0.5ÃÊ, 0.3ÃÊ, 120¹Ð¸®¼¼ÄÁµå ¶ó´Â ¶æÀÌ´Ù. 3. transition-timing-fuction transition ±¸¹®ÀÇ ¼¼¹ø° ÀÚ¸®¿¡ ¿À´Â transition-timing-functingÀº º¯È°¡ ÀϾ´Â ¼Óµµ¸¦ ¼³Á¤ÇÑ´Ù. ¼Óµµ Ä¿ºêÀÇ ÇÔ¼ö¸¦ ¼³Á¤ÇÑ´Ù´Â °ÍÀÌ ´õ Á¤È®ÇÑ Ç¥ÇöÀÌ°ÚÁö¸¸, ¾î·Á¿î ¸» º¸´Ù´Â ½ÇÁ¦ ¿òÁ÷ÀÓÀ» º¸¸é¼ ÀÌÇØÇÏ´Â °ÍÀÌ ÆíÇÏ´Ù. transition-timing-functionÀÇ °ª(value)À¸·Î´Â - linear : transition-timing-functionÀ» linear·Î ¼³Á¤ÇÏ¸é º¯È°¡ ½ÃÀÛºÎÅÍ Á¾·á±îÁö µ¿ÀÏÇÑ ¼Óµµ·Î ÀϾÙ. - ease : ease´Â ±ØÃʹÝÀº ´À¸®°Ô, ÃʹÝÀº ºü¸£°Ô, Á¾·áÁöÁ¡Àº ´À¸®°Ô º¯È°¡ ÁøÇàµÈ´Ù. - ease-in : ease-inÀº ½ÃÀÛÁöÁ¡ÀÇ º¯È°¡ õõÈ÷ ÁøÇàµÈ´Ù. - ease-out : ease-outÀº Á¾·áÁöÁ¡ÀÇ º¯È°¡ õõÈ÷ ÁøÇàµÈ´Ù. - ease-in-out : ease-in-outÀº ½ÃÀÛÁöÁ¡°ú Á¾·áÁöÁ¡ÀÇ º¯È°¡ õõÈ÷ ÁøÇàµÈ´Ù. -±âŸ¼Ó¼º : cubic-bezier, step-start, step-end, steps µîµîÀÌ ÀÖ´Ù. ÁÖ·Î ¾²ÀÌ´Â °ÍÀº linear, ease, ease-in, ease-out, ease-in-out ÀÌ·¸°Ô 5°¡ÁöÀÌ´Ù. ÀÌ 5°¡Áö¸¸ ¾Ë°í À־ transitionÀ» È°¿ëÇϴµ¥¿¡´Â Å« ¹«¸®°¡ ¾ø´Ù. 4. transition-delay transition ±¸¹®ÀÇ ¸¶Áö¸· ³×¹ø° ÀÚ¸®¿¡ ¿À´Â transition-delay ´Â transition È¿°ú°¡ ¾ðÁ¦ ½ÃÀÛÇÒÁö¸¦ ¼³Á¤ÇÑ´Ù. ¸» ±×´ë·Î, µô·¹ÀÌ(delay)¸¦ ¼³Á¤ÇÑ´Ù. transition:width 2s ease-in 1s; À§ ¿¹Á¦´Â ¸¶¿ì½º Ä¿¼¸¦ ¿Ã¸®¸é 1ÃÊ°¡ Áö³ ÈÄ 2ÃÊ¿¡ °ÉÃÄ ³Êºñ°¡ È®ÀåµÈ´Ù. 5. transitionÀÇ default °ª transitionÀÇ default °ªÀº all 0 ease 0 transition ±¸¹®¿¡¼ »ý·«µÈ °ªÀº default °ªÀ¸·Î ´ëüµÈ´Ù. transition È¿°ú°¡ ³ªÅ¸³ª±â À§Çؼ ¹Ýµå½Ã ÁÖ¾îÁ®¾ß ÇÏ´Â °ª, Áï »ý·«Çؼ± ¾ÈµÇ´Â °ªÀº transition-duration ÀÌ´Ù. 0ÃÊ¿¡ °ÉÄ£ Á¡ÁøÀûÀÎ º¯È¶ó´Â °ÍÀº ÀÖÀ» ¼ö ¾ø±â ¶§¹®ÀÌ´Ù. transitionÀÇ °ªÀ¸·Î '2s'¸¸ ÀÔ·ÂÇß´Ù. »ý·«µÈ °ªÀº default °ªÀ¸·Î ´ëüµÇ¹Ç·Î, transition:2s; ´Â transition:all 2s ease 0; °ú °°´Ù.
|