码迷,mamicode.com
首页 > 其他好文 > 详细

时间轴

时间:2014-11-04 12:53:33      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:style   http   io   ar   os   java   for   sp   div   

<!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:91px;
 top:506px;
 width:417px;
 height:3px;
 z-index:1;
}
-->
</style>
<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_popupMsg(msg) { //v1.0
  alert(msg);
}

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(3);
    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, 52);
    document.MM_Time[0][0].values = new Array(4);
    if (ns5 || macIE5)
        document.MM_Time[0][0].values[0] = new Array("662px", "651px", "640px", "628px", "617px", "606px", "595px", "584px", "572px", "561px", "550px", "539px", "528px", "516px", "505px", "494px", "483px", "472px", "460px", "449px", "438px", "427px", "416px", "404px", "393px", "382px", "371px", "360px", "349px", "337px", "326px", "315px", "304px", "293px", "281px", "270px", "259px", "248px", "237px", "225px", "214px", "203px", "192px", "181px", "169px", "158px", "147px", "136px", "125px", "113px", "102px", "91px");
    else
        document.MM_Time[0][0].values[0] = new Array(662,651,640,628,617,606,595,584,572,561,550,539,528,516,505,494,483,472,460,449,438,427,416,404,393,382,371,360,349,337,326,315,304,293,281,270,259,248,237,225,214,203,192,181,169,158,147,136,125,113,102,91);
    document.MM_Time[0][0].values[0].prop = "left";
    if (ns5 || macIE5)
        document.MM_Time[0][0].values[1] = new Array("173px", "180px", "186px", "193px", "199px", "206px", "212px", "219px", "225px", "232px", "238px", "245px", "251px", "258px", "264px", "271px", "277px", "284px", "291px", "297px", "304px", "310px", "317px", "323px", "330px", "336px", "343px", "349px", "356px", "362px", "369px", "375px", "382px", "388px", "395px", "402px", "408px", "415px", "421px", "428px", "434px", "441px", "447px", "454px", "460px", "467px", "473px", "480px", "486px", "493px", "499px", "506px");
    else
        document.MM_Time[0][0].values[1] = new Array(173,180,186,193,199,206,212,219,225,232,238,245,251,258,264,271,277,284,291,297,304,310,317,323,330,336,343,349,356,362,369,375,382,388,395,402,408,415,421,428,434,441,447,454,460,467,473,480,486,493,499,506);
    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";
    }
    if (ns5 || macIE5)
        document.MM_Time[0][0].values[2] = new Array("441px", "440px", "440px", "439px", "439px", "438px", "438px", "437px", "437px", "436px", "436px", "435px", "435px", "434px", "434px", "433px", "433px", "433px", "432px", "432px", "431px", "431px", "430px", "430px", "429px", "429px", "428px", "428px", "427px", "427px", "426px", "426px", "425px", "425px", "425px", "424px", "424px", "423px", "423px", "422px", "422px", "421px", "421px", "420px", "420px", "419px", "419px", "418px", "418px", "417px", "417px", "417px");
    else
        document.MM_Time[0][0].values[2] = new Array(441,440,440,439,439,438,438,437,437,436,436,435,435,434,434,433,433,433,432,432,431,431,430,430,429,429,428,428,427,427,426,426,425,425,425,424,424,423,423,422,422,421,421,420,420,419,419,418,418,417,417,417);
    document.MM_Time[0][0].values[2].prop = "width";
    if (!ns4)
        document.MM_Time[0][0].values[2].prop2 = "style";
    if (ns5 || macIE5)
        document.MM_Time[0][0].values[3] = new Array("230px", "225px", "221px", "216px", "212px", "207px", "203px", "198px", "194px", "189px", "185px", "181px", "176px", "172px", "167px", "163px", "158px", "154px", "149px", "145px", "140px", "136px", "132px", "127px", "123px", "118px", "114px", "109px", "105px", "100px", "96px", "92px", "87px", "83px", "78px", "74px", "69px", "65px", "60px", "56px", "51px", "47px", "43px", "38px", "34px", "29px", "25px", "20px", "16px", "11px", "7px", "3px");
    else
        document.MM_Time[0][0].values[3] = new Array(230,225,221,216,212,207,203,198,194,189,185,181,176,172,167,163,158,154,149,145,140,136,132,127,123,118,114,109,105,100,96,92,87,83,78,74,69,65,60,56,51,47,43,38,34,29,25,20,16,11,7,3);
    document.MM_Time[0][0].values[3].prop = "height";
    if (!ns4)
        document.MM_Time[0][0].values[3].prop2 = "style";
    document.MM_Time[0][1] = new String("behavior");
    document.MM_Time[0][1].frame = 53;
    document.MM_Time[0][1].value = "MM_timelineGoto(‘Timeline1‘,‘1‘)";
    document.MM_Time[0][2] = new String("behavior");
    document.MM_Time[0][2].frame = 25;
    document.MM_Time[0][2].value = "MM_popupMsg(‘HELLO 酷狗‘)";
    document.MM_Time[0].lastFrame = 53;
    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 onload="MM_timelinePlay(‘Timeline1‘)">
<div id="Layer1" style="left: 393px; top: 330px; width: 429px; height: 123px;"><img src="http://ww3.sinaimg.cn/bmiddle/e0ac7c5agw1ejuqf798ugj20rs0go78b.jpg" name="a" width="440" height="264" id="a" /></div>
</body>
</html>

时间轴

标签:style   http   io   ar   os   java   for   sp   div   

原文地址:http://www.cnblogs.com/ParkYuchun/p/4073135.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!