⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 14-8.htm

📁 JScript网页特效,包含很多的实现网页特效的方法.
💻 HTM
字号:
<html>
<head>
<title>§14.8 窗口左边的隐藏菜单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<script language="JavaScript">

function move(x)     //将层平移x个象素
{
  if (document.all)
  {
    object1.style.pixelLeft += x
    object1.style.visibility = "visible"}
    else 
      if (document.layers) 
      {
        document.object1.left += x
        document.object1.visibility = "show"
       }
  }

function makeStatic()  //固定层在窗口中指定位置,即始终浮在窗口中指定位置
{
  if (document.all) 
  {
    object1.style.pixelTop=document.body.scrollTop+20
  }
  else
  {
    eval(document.object1.top=eval(window.pageYOffset+20))
  }
  setTimeout("makeStatic()",0)
}

function positionmenu()  //将菜单层向左移动132个像素
{
  move(-132)
}
</script>

<style>
<!--

.hl	{
		Background-Color : yellow;
		Cursor:hand;
	}
.n	{
		Cursor:hand;
	}
-->
</style>
<LAYER visibility="hide" top="20" name="object1" bgcolor="black" left="0" onmouseover="move(132)" onmouseout="move(-132)">

<script language="JavaScript">

if (document.all) 
{
  document.write('<DIV ID="object1" style="visibility:hidden;cursor:hand; Position : Absolute ;Left : 0px ;Top : 20px ;Z-Index : 20" onmouseover="move(132)" onmouseout="move(-132)">')
}
</script>
<table border="0" cellpadding="0" cellspacing="1" width="150" bgcolor="#000000">
<tr>
    <td bgcolor="#0099FF"> <font size="4" face="Arial"><b>菜单</b></font></td>

<script language="JavaScript">
<!--
document.write('<td align="center" rowspan="100" width="16" bgcolor="#FF6666"><span style="font-size:14px"><p align="center"><font face="黑体">这<br>里<br>有<br>隐<br>藏<br>菜<br>单</font></p></span></TD>')
document.write('</tr>')

if (document.all||document.layers) 
{
  makeStatic()
}

var text=new Array();    //存储菜单项文本内容
var thelink=new Array(); //存储菜单项链接地址

//configure thelinks below. Extend as desired

text[0]="本站首页";
text[1]="栏目一";
text[2]="栏目一";
text[3]="栏目一";
text[4]="栏目一";
text[5]="栏目一";
text[6]="留言本";
text[7]="给我来信";

thelink[0]="http://javascript100.yeah.net";
thelink[1]="http://javascript100.yeah.net";
thelink[2]="http://javascript100.yeah.net";
thelink[3]="http://javascript100.yeah.net";
thelink[4]="http://javascript100.yeah.net";
thelink[5]="http://javascript100.yeah.net";
thelink[6]="http://javascript100.yeah.net";
thelink[7]="mailto:future3@yeah.net";


var linktarget=''     //新网页打开的目标窗口

///DO NOT EDIT BELOW THIS LINE////////////////

function navigateie(which)
{
  if (linktarget=='')
    window.location=thelink[which]
  else
   if (linktarget=='new')
     window.open(thelink[which])
   else
   {
     temp_var=eval("window.parent."+linktarget)
     temp_var.location=thelink[which]
   }
}

for (i=0;i<=text.length-1;i++)
  if (document.all)
  {
    document.write('<TR><TD height=20 bgcolor=white onclick="navigateie('+i+')" onmouseover="className=\'hl\'" onmouseout="className=\'n\'"><FONT SIZE=2>&nbsp;'+text[i]+'</FONT></TD></TR>')
  }
  else
  {
    document.write('<TR><TD bgcolor="white"><ILAYER><LAYER HEIGHT="18" onmouseover="this.bgColor=\'yellow\'" onmouseout="this.bgColor=\'white\'" width=131><FONT SIZE=2>&nbsp;<A HREF="'+thelink[i]+'" target="'+linktarget+'" id="nounderline">'+text[i]+'</A></FONT></LAYER></ILAYER></TD></TR>')
  }
//-->
</script>
<tr>
<td bgcolor="#0099FF"><font size="1" face="Arial"> </font></td>
</TR>
</table>
<script language="JavaScript">
if (document.all) 
{
  document.write('</DIV>')
}
window.onload=positionmenu
</script>
</LAYER>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -