189、隐藏导航栏

189、隐藏导航栏

脚本说明:

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

<script language="JavaScript">

<!--

function MM_initTimelines() {

var ns = navigator.appName == "Netscape";

document.MM_Time = new Array(2);

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

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 (ns)

document.MM_Time[0][0].obj = document["Layer1"];

else

document.MM_Time[0][0].obj = document.all ? document.all["Layer1"] : null;

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

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

document.MM_Time[0][0].values[0] = new Array(10,-2,-14,-27,-39,-51,-63,-76,-88,-100);

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

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

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

if (!ns) {

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

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

}

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

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

if (!ns)

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

document.MM_Time[0][0].values[3] = new Array(127,127,127,128,128,128,129,129,129,130);

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

if (!ns)

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

document.MM_Time[0][0].values[4] = new Array(57,59,62,64,67,69,72,74,77,80);

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

if (!ns)

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

document.MM_Time[0].lastFrame = 10;

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

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("sprite");

document.MM_Time[1][0].slot = 1;

if (ns)

document.MM_Time[1][0].obj = document["Layer1"];

else

document.MM_Time[1][0].obj = document.all ? document.all["Layer1"] : null;

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

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

document.MM_Time[1][0].values[0] = new Array(-100,-89,-78,-67,-56,-44,-33,-22,-11,0);

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

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

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

if (!ns) {

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

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

}

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

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

if (!ns)

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

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

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

if (!ns)

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

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

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

if (!ns)

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

document.MM_Time[1].lastFrame = 10;

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>

<script language="JavaScript">

<!--

function MM_timelinePlay(tmLnName, myID) {

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;

} }

}

//-->

</script>

<script language="JavaScript">

<!--

function MM_timelineGoto(tmLnName, fNew, numGotos) { //v1.2

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

} } } }

tmLn.curFrame = fNew;

if (tmLn.ID == 0) eval('MM_timelinePlay(tmLnName)');

}

//-->

</script>

<div id="Layer1" style="position:absolute; width:77px; height:57px; z-index:1; left: 0px; top: 150px; visibility: inherit">

<table border="0" cellpadding=0 cellspacing=0 width="120" bordercolor="#9c9cff">

<tr>

<td width="50" bgcolor="#FF00FF">

<div align="center"><font size=-1><a href="http://www.163.com" target="bot">网易</a></font></div>

</td>

<td width="14"><a href="#" onClick="MM_timelineGoto('Timeline1','1');MM_timelinePlay('Timeline1')"><img src="left1.gif" width="12" height="12" alt="隱藏" border="0"></a></td>

</tr>

<tr>

<td width="50" bgcolor="#FF00FF">

<div align="center"><font size=-1><a href="http://www.sina.com.cn" target="bot">新浪</a></font></div>

</td>

<td align=center width="14" rowspan="2" bgcolor="#FF00FF"><font size="-1" color="#00FFFF">目錄</font></td>

</tr>

<tr>

<td width="50" bgcolor="#FF00FF">

<div align="center"><font size=-1><a href="http://www.yahoo.com.cn" target="bot">雅虎</a></font></div>

</td>

</tr>

<tr>

<td width="50" bgcolor="#FF00FF">

<div align="center"><font size=-1><a href="http://www.7stk.com/" target="bot">搜狐</a></font></div>

</td>

<td width="14"><a href="#" onClick="MM_timelineGoto('Timeline2','1');MM_timelinePlay('Timeline2')"><img src="right1.gif" width="12" height="12" alt="顯示" border="0"></a></td>

</tr>

</table>

</div>

 

Write a comment

Comments: 0