全部原码如下,请各位朋友帮忙,在下感谢万分!!!!!!!!!<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统模块管理</title><style type='text/css'>
  .headtd1 {  background: #00A4E1; border: 2px outset; border-color: #00BBFF #0077FF #0077FF #00BBFF;
              cursor: hand; font-size: 9pt}
  .headtd2 {  background: #20C1FF; border: 2px outset; border-color: #60D3FF #0077FF #0077FF #60D3FF; cursor: hand;
              font-size: 9pt}
  .bodytd  {  background: #E7E3E7; border: 0px outset; border-color: #B0D8FF #0077FF #0077FF #B0D8FF; font-size: 9pt}
</style>
</head>
<body background="left.jpg"  >
  <script language='JavaScript'>var objcount = 2; //模块数量
var page_height = parseInt(document.body.clientHeight/10)*10; //页面高度整型值var headHeight = 40;
var itemHeight = page_height-headHeight*(objcount)-5; //列表内容高度
var step = 10;
function showme(obj1,obj2)
{
// for(i=0;i<document.all.tags('td').length;i++)
// if (document.all.tags('td')[i].className.indexOf('headtd') == 0)
// document.all.tags('td')[i].className = 'headtd1';
// obj2.className = 'headtd2';
moveme(obj1);
}
function moveme(obj)
{
idnumber = parseInt(obj.id.substr(4));
        //小于等于ID移上
        for(j=1;j<=idnumber;j++){
          for(i=0;i<document.all.tags('div').length;i++)
                if (document.all.tags('div')[i].id == 'item'+j+'body')
                {
                    obj = document.all.tags('div')[i];
                    objtop = headHeight * (j - 1);
                    moveup(obj,objtop,true);
                }
        }
        //大于ID移下
        for(j=objcount;j>idnumber;j--){
          for(i=0;i<document.all.tags('div').length;i++)
                if (document.all.tags('div')[i].id == 'item'+j+'body')
                {
                    obj = document.all.tags('div')[i];
                    objtop = itemHeight+(j-1)*headHeight;
                    movedown(obj,objtop,true);
                }
        }}
function moveup(obj,objtop,ismove)
{
currenttop = parseInt(obj.style.top);
if (currenttop > objtop)
{
obj.style.top = currenttop - step;
setTimeout('moveup('+obj.id+','+objtop+','+ismove+')',1)
return;
}
moving = ismove;
}
function movedown(obj,objbuttom,ismove)
{
currenttop = parseInt(obj.style.top);
if (currenttop < objbuttom)
{
obj.style.top = currenttop + step;
setTimeout('movedown('+obj.id+','+objbuttom+','+ismove+')',1)
return;
}
moving = ismove;
}
</script>
<div id='mainboard' style='position:absolute; left:2px; top:0px; width:188px; height:500px; z-index:1;
       overflow: hidden; background: left.jpg'>
<script language='JavaScript'>
   mainboard.style.height = page_height;
</script>   <div id='item1body' style='position:absolute; left:0; top:0; width:188px; height:402px; z-index:2; overflow: hidden;'>
<table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0' style='font-size:9pt; '>
<table width='100%' border='0' cellpadding='2' cellspacing='0' style='font-size:9pt; '>
<tr><td background='button.jpg' id='item1head' height='38' onclick='showme(item1body,this)' align='center'>
&nbsp;&nbsp;&nbsp;&nbsp;电教中心基础信息</td></tr>
<TR ><TD background='ico_sister.jpg' height=35>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='e3_factory.jsp' target='rightFrame'>电教中心基础信息</A>
</TD></TR>
<TR ><TD background='ico_sister.jpg' height=35>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='e3_cbbmgl.jsp' target='rightFrame'>电教中心基础xx  </A>
</TD></TR>
</table>
</table>
</div><div id='item2body' style='position:absolute; left:0; top:40; width:188px; height:402px; z-index:3; overflow: hidden;'>
<table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0' style='font-size:9pt; '>
<table width='100%' border='0' cellpadding='2' cellspacing='0' style='font-size:9pt; '>
<tr><td background='button.jpg' id='item2head' height='38' onclick='showme(item2body,this)' align='center'>
&nbsp;&nbsp;&nbsp;&nbsp;电教中心片库管理</td></tr>
<TR ><TD background='ico_sister.jpg' height=35>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='e2_djpjcxxb_index.jsp' target='rightFrame'>电教片库管理</A>
</TD></TR>
<TR ><TD background='ico_sister.jpg' height=35>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A href='e2_find_djpjcxxb_index.jsp' target='rightFrame'>电教片信息查询</A>
</TD></TR>
</table>
</table>
</div>
</div>
<script >//     alert();
//    window.prompt();
     for (i=1;i<objcount+1;i++)
       eval("item"+i+"body").style.height = itemHeight;
      showme(item1body,"item"+objcount+"body");//设置显示第1个啦</script></body>
</html>

解决方案 »

  1.   

    问题:IE5.5中该JS语句如果加1或2的语句后
          显示效果正常.
          IE6中不加//1.2效果正常代码应该没有什么问题
    可能需要延时处理
    //1     alert();
    //2    window.prompt('','');
    settimeout("xxx",1)
    function xxx(){
    for (i=1;i<objcount+1;i++)
    eval("item"+i+"body").style.height = itemHeight;
    showme(item1body,"item"+objcount+"body");  
    }看看
      

  2.   

    你是要实现什么呢?
    我测试只看到,一块文字往下移动,到底就不动了。
    环境w2ksvr+ie5.0
      

  3.   

    <script >//     alert();
    //    window.prompt();
         for (i=1;i<objcount+1;i++)
           eval("item"+i+"body").style.height = itemHeight;
          showme(item1body,"item"+objcount+"body");//设置显示第1个啦
    //你自己注释显示第一个,但是你现在的objcount等于几呢?
    </script>