{"id":5075,"date":"2016-06-12T11:08:49","date_gmt":"2016-06-12T03:08:49","guid":{"rendered":"https:\/\/sdeno.com\/?p=5075"},"modified":"2016-06-12T11:16:40","modified_gmt":"2016-06-12T03:16:40","slug":"gasp-timelinemax%e6%97%b6%e9%97%b4%e8%bd%b4","status":"publish","type":"post","link":"https:\/\/sdeno.com\/?p=5075","title":{"rendered":"GASP | TimelineMax\u65f6\u95f4\u8f74"},"content":{"rendered":"<pre>TimelineMax\r\n.<span style=\"color: #ff0000;\">add<\/span>() \/\/\u5728\u65f6\u95f4\u672b\u5c3e\u6dfb\u52a0\u4e00\u4e2a\u52a8\u753b\u3001\u6807\u7b7e\u3001\u56de\u8c03\r\n\/\/add a tween to the end of the timeline\r\n tl.add( TweenLite.to(element, 2, {left:100}) );\r\n \r\n \/\/add a callback at 1.5 seconds\r\n tl.add(func, 1.5); \r\n \r\n \/\/add a label 2 seconds after the end of the timeline (with a gap of 2 seconds)\r\n tl.add(\"myLabel\", \"+=2\");\r\n \r\n \/\/add another timeline at \"myLabel\"\r\n tl.add(otherTimeline, \"myLabel\"); \r\n \r\n \/\/add an array of tweens 2 seconds after \"myLabel\"\r\n tl.add([tween1, tween2, tween3], \"myLabel+=2\"); \r\n \r\n \/\/add an array of tweens so that they are sequenced one-after-the-other with 0.5 seconds inbetween them, starting 2 seconds after the end of the timeline\r\n tl.add([tween1, tween2, tween3], \"+=2\", \"sequence\", 0.5);<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">.addPause<\/span>() \/\/\u6dfb\u52a0\u4e00\u4e2a\u6682\u505c\uff0c\u80fd\u5728\u6307\u5b9a\u65f6\u95f4\u540e\u6682\u505c\u5e76\u56de\u8c03<\/p>\n<pre>.addPause(10, function(a,b){console.log(a,b)}, [\"param1\", \"param2\"], this); \/\/\u572810\u79d2\u540e\u6682\u505c\u5e76\u56de\u8c03<\/pre>\n<p><span style=\"color: #ff0000;\">addCallback<\/span>() \/\/\u529f\u80fd\u7528\u6cd5\u3001\u53c2\u6570\u8ddfaddPause()\u4e00\u6837\u53ea\u662f\u7f3a\u5c11\u4e86\u6682\u505c\u529f\u80fd<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #ff0000;\">set<\/span>() \/\/\u7acb\u523b\u751f\u6548\uff0c\u4e0d\u8fdb\u884c\u8fc7\u6e21\u6548\u679c<\/p>\n<pre>.set('#box', {opacity:0.5})<\/pre>\n<p>\u5177\u4f53\u66f4\u591a\u53c2\u8003\uff1a<br \/>\n<a href=\"http:\/\/greensock.com\/docs\/#\/HTML5\/GSAP\/TimelineMax\/\" target=\"_blank\">http:\/\/greensock.com\/docs\/#\/HTML5\/GSAP\/TimelineMax\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>TimelineMax .add() \/\/\u5728\u65f6\u95f4\u672b\u5c3e\u6dfb\u52a0\u4e00\u4e2a\u52a8\u753b\u3001\u6807\u7b7e\u3001\u56de\u8c03 \/\/add a tween to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,38],"tags":[],"class_list":["post-5075","post","type-post","status-publish","format-standard","hentry","category-11","category-gsap"],"_links":{"self":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5075"}],"version-history":[{"count":0,"href":"https:\/\/sdeno.com\/index.php?rest_route=\/wp\/v2\/posts\/5075\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdeno.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}