加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

GreenSock推出了新一代动画引擎平台GreenSock Animatio...

发布时间:2020-12-15 18:48:11 所属栏目:百科 来源:网络整理
导读:Flash业界久负盛名的动画引擎(TweenLite等)GreenSock推出了新一代动画引擎平台GreenSock Animation Platform,最棒的是包括JS版本!速速围观:http://t.cn/zOncGme?,入门教程http://t.cn/zOnSyWr?,压力测试案例:http://t.cn/zOnSyWB? JS版本: script?ty

Flash业界久负盛名的动画引擎(TweenLite等)GreenSock推出了新一代动画引擎平台GreenSock Animation Platform,最棒的是包括JS版本!速速围观:http://t.cn/zOncGme?,入门教程http://t.cn/zOnSyWr?,压力测试案例:http://t.cn/zOnSyWB?

GreenSock Animation Platform V12


JS版本:

<script?type="text/javascript"?src="js/TweenMax.min.js"></script>
var?photo?=?document.getElementById("photo");?//or?use?jQuery's?$("#photo")
TweenLite.to(photo,?1.5,?{width:100});
?//fade?out?all?of?the?elements?with?the?class?"myClass"?
?TweenLite.to(?$(".myClass"),?1,?{css:{opacity:0}});???
?
?//tween?the?width?of?the?element?with?id?"myElement"?to?500px?
?TweenLite.to(?$("#myElement"),?{css:{width:"500px"},?ease:Elastic.eaSEOut});???
?
?//tween?the?"marginTop"?of?all?objects?of?the?class?"myClass"?in?a?staggered?fashion?so?that?they?appear?to?fall?into?place?from?100px?up?
?var?tl?=?new?TimelineLite();?
?tl.staggerFrom(?$(".myClass"),?{css:{marginTop:"-=100px",?opacity:0}},?0.1);???
?//or?use?jQuery's?each()?method?to?loop?through?the?results?and?stagger?a?fade?out?
?$(".myClass").each(?function(index,?element)?{?????
?????TweenLite.to(?element,?{css:{autoAlpha:0},?delay:index?*?0.2});?
?});???
?//add?a?click?handler?that?uses?$(this)?to?refer?to?the?menu?element?that?was?clicked?and?tween?its?height?to?100px?
?$("#menu").click(function(){?
?????TweenLite.to(?$(this),?0.7,?{?css:{height:"100px"},?ease:Power2.easeInOut?}?);
?});



AS3.0版本:

//notice?the?target?is?an?array?
TweenLite.to([mc1,?mc2,?mc3],?{alpha:0});???
var?tl:TimelineLite?=?new?TimelineLite();?//previously?only?appendMultiple()?could?handle?arrays.?Now?append()?and?insert()?can?too.?
tl.append(?[tween1,?tween2,?tween3]?);?
tl.insert(?[tween1,?tween3]?);???//kill?all?tweens?of?mc1,?and/or?mc3

试用了一下(傲游3.0),TweenLite一开始还挺快的,测试后CPU100%就没下来过。(看了一下任务管理器,不是傲游在占用,见GUI了)-_-!!?

我用IETester V0.4.11测试(IE6~9)都报错。
用IE9和IE7兼容模式可以。

大家都去测试一下,看性能怎么样。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读