首页 > 代码库 > 时间轴
时间轴
<!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=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:512px;
top:84px;
width:154px;
height:173px;
z-index:1;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
function MM_timelinePlay(tmLnName, myID) { //v1.2
//Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (myID == null) { myID = ++tmLn.ID; firstTime=true;}//if new call, incr ID
if (myID == tmLn.ID) { //if Im newest
setTimeout(‘MM_timelinePlay("‘+tmLnName+‘",‘+myID+‘)‘,tmLn.delay);
fNew = ++tmLn.curFrame;
for (i=0; i<tmLn.length; i++) {
sprite = tmLn[i];
if (sprite.charAt(0) == ‘s‘) {
if (sprite.obj) {
numKeyFr = sprite.keyFrames.length; firstKeyFr = sprite.keyFrames[0];
if (fNew >= firstKeyFr && fNew <= sprite.keyFrames[numKeyFr-1]) {//in range
keyFrm=1;
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr != props.length) {
if (props.prop2 == null) sprite.obj[props.prop] = props[fNew-firstKeyFr];
else sprite.obj[props.prop2][props.prop] = props[fNew-firstKeyFr];
} else {
while (keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]) keyFrm++;
if (firstTime || fNew==sprite.keyFrames[keyFrm-1]) {
if (props.prop2 == null) sprite.obj[props.prop] = props[keyFrm-1];
else sprite.obj[props.prop2][props.prop] = props[keyFrm-1];
} } } } }
} else if (sprite.charAt(0)==‘b‘ && fNew == sprite.frame) eval(sprite.value);
if (fNew > tmLn.lastFrame) tmLn.ID = 0;
} }
}
function MM_initTimelines() { //v4.0
//MM_initTimelines() Copyright 1997 Macromedia, Inc. All rights reserved.
var ns = navigator.appName == "Netscape";
var ns4 = (ns && parseInt(navigator.appVersion) == 4);
var ns5 = (ns && parseInt(navigator.appVersion) > 4);
var macIE5 = (navigator.platform ? (navigator.platform == "MacPPC") : false) && (navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4);
document.MM_Time = new Array(1);
document.MM_Time[0] = new Array(2);
document.MM_Time["Timeline1"] = document.MM_Time[0];
document.MM_Time[0].MM_Name = "Timeline1";
document.MM_Time[0].fps = 15;
document.MM_Time[0][0] = new String("sprite");
document.MM_Time[0][0].slot = 1;
if (ns4)
document.MM_Time[0][0].obj = document["Layer1"];
else if (ns5)
document.MM_Time[0][0].obj = document.getElementById("Layer1");
else
document.MM_Time[0][0].obj = document.all ? document.all["Layer1"] : null;
document.MM_Time[0][0].keyFrames = new Array(1, 6, 11, 17, 28, 40, 47, 49, 50, 57, 63, 69, 72, 78, 87, 88, 91, 97, 98, 100, 105, 115, 118, 119, 120, 124, 140, 141, 142, 150);
document.MM_Time[0][0].values = new Array(2);
if (ns5 || macIE5)
document.MM_Time[0][0].values[0] = new Array("105px", "108px", "111px", "114px", "116px", "118px", "119px", "118px", "117px", "117px", "119px", "122px", "125px", "128px", "133px", "139px", "147px", "153px", "159px", "165px", "172px", "179px", "186px", "194px", "202px", "211px", "219px", "228px", "236px", "245px", "254px", "262px", "271px", "280px", "288px", "296px", "304px", "311px", "318px", "324px", "328px", "327px", "324px", "320px", "317px", "314px", "311px", "303px", "297px", "288px", "286px", "284px", "281px", "279px", "277px", "275px", "275px", "277px", "279px", "283px", "287px", "292px", "297px", "303px", "310px", "317px", "324px", "330px", "336px", "342px", "342px", "342px", "343px", "343px", "344px", "344px", "343px", "337px", "330px", "322px", "313px", "304px", "295px", "287px", "280px", "273px", "267px", "264px", "262px", "259px", "260px", "265px", "271px", "277px", "284px", "289px", "293px", "294px", "300px", "309px", "314px", "320px", "327px", "335px", "345px", "352px", "359px", "367px", "375px", "384px", "392px", "400px", "407px", "413px", "419px", "429px", "434px", "439px", "444px", "446px", "448px", "450px", "451px", "451px", "450px", "450px", "449px", "448px", "447px", "446px", "444px", "443px", "442px", "440px", "439px", "438px", "437px", "436px", "436px", "435px", "442px", "450px", "455px", "462px", "469px", "477px", "485px", "494px", "503px", "512px");
else
document.MM_Time[0][0].values[0] = new Array(105,108,111,114,116,118,119,118,117,117,119,122,125,128,133,139,147,153,159,165,172,179,186,194,202,211,219,228,236,245,254,262,271,280,288,296,304,311,318,324,328,327,324,320,317,314,311,303,297,288,286,284,281,279,277,275,275,277,279,283,287,292,297,303,310,317,324,330,336,342,342,342,343,343,344,344,343,337,330,322,313,304,295,287,280,273,267,264,262,259,260,265,271,277,284,289,293,294,300,309,314,320,327,335,345,352,359,367,375,384,392,400,407,413,419,429,434,439,444,446,448,450,451,451,450,450,449,448,447,446,444,443,442,440,439,438,437,436,436,435,442,450,455,462,469,477,485,494,503,512);
document.MM_Time[0][0].values[0].prop = "left";
if (ns5 || macIE5)
document.MM_Time[0][0].values[1] = new Array("65px", "72px", "80px", "87px", "95px", "102px", "109px", "116px", "123px", "131px", "138px", "144px", "149px", "154px", "159px", "163px", "168px", "171px", "174px", "177px", "180px", "183px", "186px", "189px", "191px", "193px", "195px", "196px", "196px", "197px", "196px", "196px", "195px", "194px", "193px", "191px", "190px", "188px", "186px", "183px", "175px", "167px", "161px", "156px", "151px", "147px", "143px", "140px", "142px", "144px", "149px", "155px", "162px", "170px", "178px", "186px", "194px", "202px", "208px", "215px", "220px", "226px", "231px", "236px", "241px", "245px", "248px", "251px", "253px", "252px", "247px", "241px", "236px", "230px", "223px", "215px", "207px", "200px", "197px", "196px", "195px", "195px", "195px", "195px", "195px", "196px", "196px", "206px", "212px", "219px", "227px", "231px", "235px", "239px", "242px", "245px", "247px", "249px", "247px", "247px", "248px", "251px", "254px", "255px", "255px", "254px", "252px", "249px", "247px", "244px", "241px", "238px", "236px", "234px", "232px", "230px", "229px", "229px", "227px", "227px", "221px", "214px", "205px", "190px", "184px", "177px", "170px", "162px", "154px", "146px", "137px", "127px", "118px", "110px", "102px", "94px", "87px", "81px", "75px", "69px", "68px", "68px", "69px", "71px", "73px", "75px", "77px", "79px", "82px", "84px");
else
document.MM_Time[0][0].values[1] = new Array(65,72,80,87,95,102,109,116,123,131,138,144,149,154,159,163,168,171,174,177,180,183,186,189,191,193,195,196,196,197,196,196,195,194,193,191,190,188,186,183,175,167,161,156,151,147,143,140,142,144,149,155,162,170,178,186,194,202,208,215,220,226,231,236,241,245,248,251,253,252,247,241,236,230,223,215,207,200,197,196,195,195,195,195,195,196,196,206,212,219,227,231,235,239,242,245,247,249,247,247,248,251,254,255,255,254,252,249,247,244,241,238,236,234,232,230,229,229,227,227,221,214,205,190,184,177,170,162,154,146,137,127,118,110,102,94,87,81,75,69,68,68,69,71,73,75,77,79,82,84);
document.MM_Time[0][0].values[1].prop = "top";
if (!ns4) {
document.MM_Time[0][0].values[0].prop2 = "style";
document.MM_Time[0][0].values[1].prop2 = "style";
}
document.MM_Time[0][1] = new String("behavior");
document.MM_Time[0][1].frame = 150;
document.MM_Time[0][1].value = "http://www.mamicode.com/MM_popupMsg(‘Thank you for‘)";
document.MM_Time[0].lastFrame = 150;
for (i=0; i<document.MM_Time.length; i++) {
document.MM_Time[i].ID = null;
document.MM_Time[i].curFrame = 0;
document.MM_Time[i].delay = 1000/document.MM_Time[i].fps;
}
}
//-->
</script>
</head>
<body onl oad="MM_timelinePlay(‘Timeline1‘)">
<div id="Layer1" style="left: 512px; top: 84px;"><img src="http://www.mamicode.com/d439b6003af33a8793ddd41bc45c10385343b57b.jpg" width="200" height="200" /></div>
</body>
</html>
时间轴