html 使用TweenLite和TimelineLite的简单时间轴示例。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 使用TweenLite和TimelineLite的简单时间轴示例。相关的知识,希望对你有一定的参考价值。

var $homecaption1 = $('#homecaption1'),
  $homecaption2 = $('#homecaption2'),
  $homecaption3 = $('#homecaption3'),
  $homecaption4 = $('#homecaption4'),
  $homecaption5 = $('#homecaption5'),
  tl = new TimelineLite();

	tl.fromTo($homecaption1, 2, {autoAlpha: 0}, {autoAlpha: 1, display: "block"}, 0.15)
	.fromTo($homecaption2, 2, {autoAlpha: 0}, {autoAlpha: 1, display: "block"}, 1)
	.fromTo($homecaption3, 2, {autoAlpha: 0}, {autoAlpha: 1, display: "block"}, 2)

	.fromTo($homecaption1, 1, {autoAlpha: 1}, {autoAlpha: 0, display: "block"}, 5)
	.fromTo($homecaption2, 1, {autoAlpha: 1}, {autoAlpha: 0, display: "block"}, 5)
	.fromTo($homecaption3, 1, {autoAlpha: 1}, {autoAlpha: 0, display: "block"}, 5)

	.fromTo($homecaption4, 2, {autoAlpha: 0}, {autoAlpha: 1, display: "block"}, 5.5)
	.fromTo($homecaption5, 2, {autoAlpha: 0}, {autoAlpha: 1, display: "block"}, 6);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>

<script src='//cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TweenLite.min.js'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TimelineLite.min.js'></script>
<script src='//cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/plugins/CSSPlugin.min.js'></script>

</head>

<body>

<h2 id="homecaption1" class="animelem">Grander than</h2>
<h2 id="homecaption2" class="animelem">anything Houston</h2>
<h2 id="homecaption3" class="animelem">has ever seen.</h2>
<h2 id="homecaption4" class="animelem"><img src="http://www.nicenicejpg.com/300/350"></h2>
<h3 id="homecaption5" class="animelem">A new level of luxury.</h3>

</body>
</html>

以上是关于html 使用TweenLite和TimelineLite的简单时间轴示例。的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 使用AS3和Tweenlite的Spotlight导航效果

ActionScript 3 使用AS3和Tweenlite进行简单的3D 360旋转悬停效果

使用AS3和Tweenlite的聚光灯导航效果

使用AS3和Tweenlite实现简单的3D 360旋转悬停效果

Flash 动作脚本 tweenlite 1084

FLash:尝试使用setChildIndex和TweenLite创建按钮rollOver效果时出错