116、广告图片宣传

116、广告图片宣传

脚本说明:

第一步:把如下代码加入<body>区域中

<SCRIPT language=JavaScript>

<!--

function MM_reloadPage(init) {  //reloads the window if Nav4 resized

  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {

    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}

  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

}

MM_reloadPage(true);

// -->

 

function MM_timelinePlay(tmLnName, myID) { //v1.2

  //Copyright 1997 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);

    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, 35);

    document.MM_Time[0][0].values = new Array(4);

    if (ns5)

        document.MM_Time[0][0].values[0] = new Array("0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px");

    else

        document.MM_Time[0][0].values[0] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

    document.MM_Time[0][0].values[0].prop = "left";

    if (ns5)

        document.MM_Time[0][0].values[1] = new Array("0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px");

    else

        document.MM_Time[0][0].values[1] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

    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)

        document.MM_Time[0][0].values[2] = new Array("452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px");

    else

        document.MM_Time[0][0].values[2] = new Array(452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452);

    document.MM_Time[0][0].values[2].prop = "height";

    if (!ns4)

        document.MM_Time[0][0].values[2].prop2 = "style";

    document.MM_Time[0][0].values[3] = new Array("inherit","inherit");

    document.MM_Time[0][0].values[3].prop = "visibility";

    if (!ns4)

        document.MM_Time[0][0].values[3].prop2 = "style";

    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(36, 56);

    document.MM_Time[0][1].values = new Array(4);

    if (ns5)

        document.MM_Time[0][1].values[0] = new Array("0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px", "0px");

    else

        document.MM_Time[0][1].values[0] = new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);

    document.MM_Time[0][1].values[0].prop = "left";

    if (ns5)

        document.MM_Time[0][1].values[1] = new Array("0px", "-23px", "-45px", "-68px", "-90px", "-113px", "-136px", "-158px", "-181px", "-203px", "-226px", "-249px", "-271px", "-294px", "-316px", "-339px", "-362px", "-384px", "-407px", "-429px", "-452px");

    else

        document.MM_Time[0][1].values[1] = new Array(0,-23,-45,-68,-90,-113,-136,-158,-181,-203,-226,-249,-271,-294,-316,-339,-362,-384,-407,-429,-452);

    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)

        document.MM_Time[0][1].values[2] = new Array("452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px", "452px");

    else

        document.MM_Time[0][1].values[2] = new Array(452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452,452);

    document.MM_Time[0][1].values[2].prop = "height";

    if (!ns4)

        document.MM_Time[0][1].values[2].prop2 = "style";

    document.MM_Time[0][1].values[3] = new Array("inherit","inherit");

    document.MM_Time[0][1].values[3].prop = "visibility";

    if (!ns4)

        document.MM_Time[0][1].values[3].prop2 = "style";

    document.MM_Time[0].lastFrame = 56;

    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>

<DIV id=Layer1

style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 1px; Z-INDEX: 1; LEFT: 0px; BORDER-LEFT: #000000 1px; WIDTH: 780px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; TOP: 0px; HEIGHT: 452px; BACKGROUND-COLOR: #666699; layer-background-color: #666699"><IMG

src="portrait23.jpg" width=780></DIV>

 

 

 

第二步:把<body>中的内容改为:

<body onload="MM_timelinePlay('Timeline1')">

 

Write a comment

Comments: 0