首页 > 代码库 > 网页代码——王嘉昕
网页代码——王嘉昕
<!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>
<script type="text/JavaScript">
<!--
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_timelineGoto(tmLnName, fNew, numGotos) { //v2.0
//Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Macromedia, Inc. All rights reserved.
var i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,lastKeyFr,propNum,theObj;
if (document.MM_Time == null) MM_initTimelines(); //if *very* 1st time
tmLn = document.MM_Time[tmLnName];
if (numGotos != null)
if (tmLn.gotoCount == null) tmLn.gotoCount = 1;
else if (tmLn.gotoCount++ >= numGotos) {tmLn.gotoCount=0; return}
jmpFwd = (fNew > tmLn.curFrame);
for (i = 0; i < tmLn.length; i++) {
sprite = (jmpFwd)? tmLn[i] : tmLn[(tmLn.length-1)-i]; //count bkwds if jumping back
if (sprite.charAt(0) == "s") {
numKeyFr = sprite.keyFrames.length;
firstKeyFr = sprite.keyFrames[0];
lastKeyFr = sprite.keyFrames[numKeyFr - 1];
if ((jmpFwd && fNew<firstKeyFr) || (!jmpFwd && lastKeyFr<fNew)) continue; //skip if untouchd
for (keyFrm=1; keyFrm<numKeyFr && fNew>=sprite.keyFrames[keyFrm]; keyFrm++);
for (j=0; j<sprite.values.length; j++) {
props = sprite.values[j];
if (numKeyFr == props.length) propNum = keyFrm-1 //keyframes only
else propNum = Math.min(Math.max(0,fNew-firstKeyFr),props.length-1); //or keep in legal range
if (sprite.obj != null) {
if (props.prop2 == null) sprite.obj[props.prop] = props[propNum];
else sprite.obj[props.prop2][props.prop] = props[propNum];
} }
} else if (sprite.charAt(0)==‘b‘ && fNew == sprite.frame) eval(sprite.value);
}
tmLn.curFrame = fNew;
if (tmLn.ID == 0) eval(‘MM_timelinePlay(tmLnName)‘);
}
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(2);
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("behavior");
document.MM_Time[0][0].frame = 37;
document.MM_Time[0][0].value = "http://www.mamicode.com/MM_timelineGoto(‘Timeline1‘,‘1‘)";
document.MM_Time[0][1] = new String("sprite");
document.MM_Time[0][1].slot = 1;
if (ns4)
document.MM_Time[0][1].obj = document["Layer1"];
else if (ns5)
document.MM_Time[0][1].obj = document.getElementById("Layer1");
else
document.MM_Time[0][1].obj = document.all ? document.all["Layer1"] : null;
document.MM_Time[0][1].keyFrames = new Array(1, 42);
document.MM_Time[0][1].values = new Array(4);
if (ns5 || macIE5)
document.MM_Time[0][1].values[0] = new Array("11px", "20px", "28px", "37px", "45px", "54px", "62px", "71px", "79px", "88px", "96px", "105px", "113px", "122px", "131px", "139px", "148px", "156px", "165px", "173px", "182px", "190px", "199px", "207px", "216px", "224px", "233px", "241px", "250px", "259px", "267px", "276px", "284px", "293px", "301px", "310px", "318px", "327px", "335px", "344px", "352px", "361px");
else
document.MM_Time[0][1].values[0] = new Array(11,20,28,37,45,54,62,71,79,88,96,105,113,122,131,139,148,156,165,173,182,190,199,207,216,224,233,241,250,259,267,276,284,293,301,310,318,327,335,344,352,361);
document.MM_Time[0][1].values[0].prop = "left";
if (ns5 || macIE5)
document.MM_Time[0][1].values[1] = new Array("34px", "36px", "38px", "40px", "42px", "44px", "46px", "48px", "50px", "52px", "54px", "57px", "59px", "61px", "63px", "65px", "67px", "69px", "71px", "73px", "75px", "77px", "79px", "81px", "83px", "85px", "87px", "89px", "91px", "93px", "95px", "98px", "100px", "102px", "104px", "106px", "108px", "110px", "112px", "114px", "116px", "118px");
else
document.MM_Time[0][1].values[1] = new Array(34,36,38,40,42,44,46,48,50,52,54,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,98,100,102,104,106,108,110,112,114,116,118);
document.MM_Time[0][1].values[1].prop = "top";
if (!ns4) {
document.MM_Time[0][1].values[0].prop2 = "style";
document.MM_Time[0][1].values[1].prop2 = "style";
}
if (ns5 || macIE5)
document.MM_Time[0][1].values[2] = new Array("247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px", "247px");
else
document.MM_Time[0][1].values[2] = new Array(247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247);
document.MM_Time[0][1].values[2].prop = "width";
if (!ns4)
document.MM_Time[0][1].values[2].prop2 = "style";
if (ns5 || macIE5)
document.MM_Time[0][1].values[3] = new Array("73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px", "73px");
else
document.MM_Time[0][1].values[3] = new Array(73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73,73);
document.MM_Time[0][1].values[3].prop = "height";
if (!ns4)
document.MM_Time[0][1].values[3].prop2 = "style";
document.MM_Time[0].lastFrame = 42;
document.MM_Time[1] = new Array(2);
document.MM_Time["Timeline2"] = document.MM_Time[1];
document.MM_Time[1].MM_Name = "Timeline2";
document.MM_Time[1].fps = 15;
document.MM_Time[1][0] = new String("behavior");
document.MM_Time[1][0].frame = 43;
document.MM_Time[1][0].value = "http://www.mamicode.com/MM_timelineGoto(‘Timeline2‘,‘1‘)";
document.MM_Time[1][1] = new String("sprite");
document.MM_Time[1][1].slot = 1;
if (ns4)
document.MM_Time[1][1].obj = document["Layer2"];
else if (ns5)
document.MM_Time[1][1].obj = document.getElementById("Layer2");
else
document.MM_Time[1][1].obj = document.all ? document.all["Layer2"] : null;
document.MM_Time[1][1].keyFrames = new Array(1, 41);
document.MM_Time[1][1].values = new Array(2);
if (ns5 || macIE5)
document.MM_Time[1][1].values[0] = new Array("464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "464px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px", "465px");
else
document.MM_Time[1][1].values[0] = new Array(464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,464,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465,465);
document.MM_Time[1][1].values[0].prop = "left";
if (ns5 || macIE5)
document.MM_Time[1][1].values[1] = new Array("33px", "36px", "39px", "42px", "45px", "48px", "51px", "54px", "57px", "60px", "63px", "66px", "69px", "72px", "75px", "78px", "81px", "84px", "87px", "90px", "94px", "97px", "100px", "103px", "106px", "109px", "112px", "115px", "118px", "121px", "124px", "127px", "130px", "133px", "136px", "139px", "142px", "145px", "148px", "151px", "154px");
else
document.MM_Time[1][1].values[1] = new Array(33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154);
document.MM_Time[1][1].values[1].prop = "top";
if (!ns4) {
document.MM_Time[1][1].values[0].prop2 = "style";
document.MM_Time[1][1].values[1].prop2 = "style";
}
document.MM_Time[1].lastFrame = 43;
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>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:361px;
top:118px;
width:139px;
height:113px;
z-index:1;
}
#Layer2 {
position:absolute;
left:465px;
top:154px;
width:203px;
height:178px;
z-index:2;
}
#Layer3 {
position:absolute;
left:658px;
top:10px;
width:36px;
height:38px;
z-index:3;
}
-->
</style>
</head>
<body onl oad="MM_timelinePlay(‘Timeline1‘);MM_timelinePlay(‘Timeline2‘)">
<div id="Layer1" style="left: 104px; top: 84px;"><img src="http://www.mamicode.com/1_110425085049_10.gif" width="196" height="203" /></div>
<div id="Layer2" style="top: 151px; left: 465px;"><img src="http://www.mamicode.com/20139309254249560.gif" width="195" height="188" /></div>
<div id="Layer3"><img src="http://www.mamicode.com/20130507113007227.gif" width="112" height="140" /></div>
<p> </p>
<p> </p>
</body>
</html>
网页代码——王嘉昕