日期:2014-05-17  浏览次数:20499 次

asp.net做动态菜单出现document.all.item1.style.top=parseInt(document.all.item1.style.to)
asp.net做动态菜单出现document.all.item1.style.top=parseInt(document.all.item1.style.to)参数无效,代码如下
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="lelfbotton.aspx.cs" Inherits="lelfbotton" %>
<!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 runat="server">
<style type="text/css">
  .titleStyle{
  background-image:url(images/button.gif); color:#ffffff;
  font-size:9pt;cursor:hand;
  }
  .contentStyle{
  background-color:#E4E8F3;color:blue;font-size:9pt;
  }

.style1 {
color: #999999;
font-family: "宋体", Verdana;
font-size: 9pt;
}
a:link {
color: #003366;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
color: #003366;
}
a:hover {
text-decoration: none;
color: #FF0000;
}
a:active {
text-decoration: underline;
color: #FF0000;
}
body,td,th {
color: #CCCCCC;
}
-->
</style>
</head>

<body>

  <script language="JavaScript">
<!--
 var layerTop=0; //菜单顶边距
 var layerLeft=0; //菜单左边距
 var layerWidth=130; //菜单总宽
 var titleHeight=25; //标题栏高度
 var contentHeight=330; //内容区高度
 var stepNo=10; //移动步数,数值越大移动越慢

 var itemNo=0;runtimes=0;
 document.write('<span id=itemsLayer style="position:absolute;overflow:hidden;left:'+layerLeft+';top:'+layerTop+';width:'+layerWidth+';">');
 function addItem(itemTitle,itemContent){
  itemHTML='<div id=item'+itemNo+' itemIndex='+itemNo+' style="position:relative;left:0;top:'+(-contentHeight*itemNo)+';width:'+layerWidth+';"><table width=100% cellspacing="0" cellpadding="0">'+
  '<tr><td height='+titleHeight+' onclick=changeItem('+itemNo+') class="titleStyle" align=center >'+itemTitle+'</td></tr>'+
  '<tr><td height='+contentHeight+' class="contentStyle" valign=top>'+itemContent+'</td></tr></table></div>';
  document.write(itemHTML);
  itemNo++;}
 
   

 addItem('<table width="125" height="25" border="0" cellpadding="0" cellspacing="0"><tr><td height="2"><img src="images/button/bt_gerenyouxiang.gif" width="125" height="25"></td></tr></table>','<table width=96% border="0" align=center cellpadding=0 cellspacing=1 bgcolor="E4E8F3"><tr><td height="25" bgcolor="F8FCFF"><div align="center" class="style1"><a href="tdsyjsz.asp" target="main_body">土地收益金设置</a></div></td></tr><tr><td height="25" bgcolor="F8FCFF"><div align="center" class="style1"><a href="fwflxsz.asp" target="main_body">手续费类型设置</a></div></td></tr><tr><td height="25" bgcolor="F8FCFF"><div align="center" class="style1"><a href="ssqysz.asp" target="main_body">行政区域设置</a></div></td></tr><tr><td height="25" bgcolor=&qu