¼ò½é
ÔÚ¹ýÈ¥µÄÁ½Ä꣬ԽÀ´Ô½¶àµÄͬÊ¡¢ÅóÓѺÍÆäËû²»ÈÏʶµÄͯЬ½øÐÐÒƶ¯web¿ª·¢µÄʱºò£¬¶¼Ê¹ÓÃÁËtransformjs£¬ËùÓбØÒª½éÉÜһϣ¬Èøü¶àµÄÈËÊÜÒ棬Ìá¸ß±à³ÌЧÂÊ£¬²¢ÏíÊܱà³ÌÀÖȤ¡££¨µ±È»transformjs²»½ö½öÖ§³ÖÒƶ¯É豸£¬¶¼ÄÜÕý³£Ê¹ÓÃtransformjs£©
´«ËÍÃŹٷ½ÍøÕ¾£º
GithubµØÖ·£ºhttps://github.com/AlloyTeam/AlloyTouch/tree/master/transformjs
npm install css3transform
APITransform(domElement, [notPerspective]);
ͨ¹ýÉÏÃæÒ»ÐдúÂëµÄµ÷Ó㬾ͿÉÒÔÉèÖûòÕ߶ÁÈ¡ domElementµÄ"translateX", "translateY", "translateZ", "scaleX", "scaleY", "scaleZ", "rotateX", "rotateY", "rotateZ", "skewX", "skewY", "originX", "originY", "originZ"£¡
·½±ã°É£¡
ʹÓÃ×ËÊÆ....log(domElement.translateX )
´«Í³µÄCSS3±à³ÌµÄÎÊÌâÒÔÇ°£¬ÎÒÃÇÒ»°ãʹÓÃanimate.css¡¢zepto/jQueryµÄanimate·½·¨»òÕßtween.js+css3½øÐн»»¥ÌØЧ±à³Ì¡£×ܽáÏÂÀ´ÓÐÈý¸öȱµã£º
²»Ö±¹Û¿´ÏÂÃæÕâÕÅͼ£º
˳ÐòÓ°Ïì½á¹û£¬²»Ö±¹Û¡£ÄÇôΪʲô»áÊÇÕâ¸ö½á¹û£¿¿ÉÒÔͨ¹ýnew WebKitCSSMatrix(transform_str)¶Ô±È×îÖÕµÄmatrix¡£
ÕâÒ²Ö±½Ó˵Ã÷Á˾ØÕó²»·ûºÏ½»»»ÂÉ¡£AB!=BA
²»Ö±½Ózepto×ËÊÆ£º
)
translate3d: '0,10px,0'·Ç³£²»·½±ã£¬ÎÞ·¨stepµÝ½øµÝ¼õ¿ØÖÆ¡£¸ü±ðÌáÅäºÏһЩÔ˶¯»òÕßʱ¼äµÄ¿âÀ´±à³ÌÁË¡£¿ÉÄÜÄã»á·´²µ'ease-out'²»¾Í¿ÉÒÔʵÏÖ»º¶¯Â𣿵«ÊÇÈç¹ûÎÒÐèÒªÈÃxºÍyÒÔ¼°z·Ö±ð¶ÔÓ¦²»Í¬µÄ»º¶¯º¯Êý£¬ÕâÖÖ»ùÓÚ×Ö·û´®±à³ÌµÄÐÎʽ¾Í·Ñ¾¢ÁË~~
ÕâÀﻹÐèҪעÒâµÄÊÇ£¬zeptoÀïµÄ˳ÐòÒ²»áÓ°Ïì½á¹û¡£ÒòΪÆä×îºóÒ²ÊÇÆ´³Éstring¸³¸ødomÔªËØ¡£
tween.js×ËÊÆ
target .Tween(position) .) .delay(1000) .easing(TWEEN.Easing.Elastic.InOut) .t_str........);
ʹÓÃ×Ö·û´®µÄ·½Ê½£¬¿´×žÍÐÄÀÛ¡£¸ü±ðÌáдµÄ¹ý³ÌÒªÔâÊܶàÉÙÕÛÄ¥¡£
animate.css×ËÊÆ:
@keyframes pulse scale3d(50% scale3d(1.05, 1.05, 1.05); } to scale3d(1, 1, 1); } }
animate.css·â×°ÁËÒ»´ó¶Ñ¹Ø¼üÖ¡¶¯»£¬¿ª·¢ÕßÖ»ÐèÒª¹ØÐÄÌí¼Ó»òÕßÒƳýÏà¹ØµÄ¶¯»µÄclass±ã¿ÉÒÔ¡£ÕâÒ»¶¨³Ì¶ÈÉϸø½»»¥ÌØЧ´øÀ´Á˼«´óµÄ±éÀú£¬µ«ÊÇÒªÓÐÓ²ÉË£º
²»·½±ãtransformµÄÐýתµã»ù×¼µãĬÈÏÊÇÔÚÖÐÐÄ£¬µ«ÊÇÓÐЩÊÇʱºò£¬²»ÏµÍ³ÔÚÖÐÐÄ£¬ÎÒÃÇ´«Í³µÄ×ö·¨ÊÇʹÓÃtransform-originÀ´ÉèÖûù×¼µã¡£
×¢Ò⣬ÊÇÁíÒ»¸öÊôÐÔtransform-origin£¬¶ø²»ÊÇtransform¡£µ«ÊÇÈç¹ûÐèÒªÔ˶¯transform-originÄØ£¿ÕâÖÖÉè¼ÆÊDz»ÊǾͷÏÁË£¿ÓÐûÓÐÐèÒªÔ˶¯originµÄ³¡¾°£¿Õâ¸öÔÚÓÎÏ·Éè¼ÆÖÐÊǾ³£»áʹÓõĵ½£¬Õâ¸öÒÔºóÁíÍâµ¥¶À¿ªÆªÔÙ˵£¬ÊÂʵ¾ÍÊÇ£¬Óг¡¾°ÊÇÐèÒªÔ˶¯originÀ´´ïµ½Ä³ÖÖЧ¹û¡£
transformjs»ùÓÚÉÏÃæÖÖÖÖ²»±ã£¬ËùÒÔÓÐÁËtransformjs£¡
¿ªÊ¼Ê¹Óðɣº
¹Ù·½ÍøÕ¾£º
GithubµØÖ·£ºhttps://github.com/AlloyTeam/AlloyTouch/tree/master/transformjs
¡¡