全部原码如下,请各位朋友帮忙,在下感谢万分!!!!!!!!!<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'>
电教中心基础信息</td></tr>
<TR ><TD background='ico_sister.jpg' height=35> <A href='e3_factory.jsp' target='rightFrame'>电教中心基础信息</A>
</TD></TR>
<TR ><TD background='ico_sister.jpg' height=35> <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'>
电教中心片库管理</td></tr>
<TR ><TD background='ico_sister.jpg' height=35> <A href='e2_djpjcxxb_index.jsp' target='rightFrame'>电教片库管理</A>
</TD></TR>
<TR ><TD background='ico_sister.jpg' height=35> <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>
<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'>
电教中心基础信息</td></tr>
<TR ><TD background='ico_sister.jpg' height=35> <A href='e3_factory.jsp' target='rightFrame'>电教中心基础信息</A>
</TD></TR>
<TR ><TD background='ico_sister.jpg' height=35> <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'>
电教中心片库管理</td></tr>
<TR ><TD background='ico_sister.jpg' height=35> <A href='e2_djpjcxxb_index.jsp' target='rightFrame'>电教片库管理</A>
</TD></TR>
<TR ><TD background='ico_sister.jpg' height=35> <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>
解决方案 »
- innerHTML无法显示网页问题
- 如何设置新打开窗体的大小
- JS客户端回调问题,如何保存状态
- getElementById问题 急急
- 节点的nodeName为什么用 == 无法与字符串比较??
- 用javascript怎么连接EXCEL?
- 向大家推荐一个下电子书籍的好地方,各种图书绝对经典,并且免费!!!!
- 怎样让鼠标光标变成放大/缩小的形状?
- 求大神写一个鼠标点击导航背景停留的效果
- 用户登录,后台方法没问题,查找对应用户的角色名,通过request.setAttribute(“role”,s)保存,怎么样在js里面判断传来的这个角色名参数?
- 急!!!!!表单提交后判断值是否为空的问题!
- realplayer 播放网上WMA的问题
显示效果正常.
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");
}看看
我测试只看到,一块文字往下移动,到底就不动了。
环境w2ksvr+ie5.0
// window.prompt();
for (i=1;i<objcount+1;i++)
eval("item"+i+"body").style.height = itemHeight;
showme(item1body,"item"+objcount+"body");//设置显示第1个啦
//你自己注释显示第一个,但是你现在的objcount等于几呢?
</script>