急,多个主菜单的oicq菜单的实现。 http://www.chinaaspx.com/default.asp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to 51windows(海娃) :不是这个效果,在主菜单上在点一下它会收回去的。再帮我找找吧,谢谢! <head><title>QQ菜单</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><script language='JavaScript'>var headHeight = 22;var bodyHeight = 202;var objcount = 7;var step = 10;var moving = false;function showme(obj1, obj2){if (moving)return;moving = true;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));objtop = headHeight * (idnumber - 1);objbuttom = bodyHeight + headHeight * (idnumber - 2);currenttop = parseInt(obj.style.top);if (currenttop >= objbuttom){countid = 1;for(i=0;i<document.all.tags('div').length;i++)if (document.all.tags('div')[i].id == 'item'+countid+'body'){obj = document.all.tags('div')[i];objtop = headHeight * (countid - 1);if (countid == idnumber){moveup(obj,objtop,false);break;}elsemoveup(obj,objtop,true);countid++;}}else if ((currenttop >= objtop) && (idnumber < objcount)){idnumber++;countid = objcount;for(i=document.all.tags('div').length-1;i>=0;i--)if (document.all.tags('div')[i].id == 'item'+countid+'body'){obj = document.all.tags('div')[i];objbuttom = bodyHeight + headHeight * (countid - 2);if (countid == idnumber){movedown(obj,objbuttom,false);break;}elsemovedown(obj,objbuttom,true);countid--;}}}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><style type='text/css'>.headtd1 { background: #00A4E1; border: 1px outset; border-color: #00BBFF #0077FF #0077FF #00BBFF; cursor: hand; font-size: 9pt}.headtd2 { background: #20C1FF; border: 1px outset; border-color: #60D3FF #0077FF #0077FF #60D3FF; cursor: hand; font-size: 9pt}.bodytd { background: #99CCFF; border: 1px outset; border-color: #B0D8FF #0077FF #0077FF #B0D8FF; font-size: 9pt}</style></head><div id='mainboard' style='position:absolute; left:2px; top:2px; width:120px; height:334px; z-index:1; overflow: hidden; background: #99CCFF;'> <div id='item1body' style='position:absolute; left:0; top:0; width:120px; height:202px; z-index:2; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item1head' height='20' class='headtd2' onclick='showme(item1body,this)' align='center'>菜单1</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item2body' style='position:absolute; left:0; top:202; width:120px; height:202px; z-index:3; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item2head' height='20' class='headtd1' onclick='showme(item2body,this)' align='center'>菜单2</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item3body' style='position:absolute; left:0; top:224; width:120px; height:202px; z-index:4; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item3head' height='20' class='headtd1' onclick='showme(item3body,this)' align='center'>菜单3</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item4body' style='position:absolute; left:0; top:246; width:120px; height:202px; z-index:5; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item4head' height='20' class='headtd1' onclick='showme(item4body,this)' align='center'>菜单4</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item5body' style='position:absolute; left:0; top:268; width:120px; height:202px; z-index:6; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item5head' height='20' class='headtd1' onclick='showme(item5body,this)' align='center'>菜单5</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item6body' style='position:absolute; left:0; top:290; width:120px; height:202px; z-index:7; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item6head' height='20' class='headtd1' onclick='showme(item6body,this)' align='center'>菜单6</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item7body' style='position:absolute; left:0; top:312; width:120px; height:202px; z-index:8; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item7head' height='20' class='headtd1' onclick='showme(item7body,this)' align='center'>菜单7</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div> </div></body></html> 学习JavaScript资料 如何让表单在点击submit按钮后检查前面表单验证返回的是不是都是true js参数啊! 函数括号的问题 菜鸟问题:iframe里的函数调用!! JavaScript重大问题 这段程序我已经调晕菜了,大家帮着给看看吧,谢谢你们! 控制IE的打印设置问题! 请问如何获得所选radio的值 防止js注入 js对一些特殊字符进行转义 大牛进~ 如何使在父窗口中点击弹出子窗口中,父窗口处理无法选定状态,只有了窗口关闭后,父窗口才可使用呢。 使用全局变量的一个怪问题:怎么在函数中不可用?
再帮我找找吧,谢谢!
<title>QQ菜单</title>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<script language='JavaScript'>
var headHeight = 22;var bodyHeight = 202;var objcount = 7;var step = 10;var moving = false;
function showme(obj1, obj2)
{
if (moving)
return;
moving = true;
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));
objtop = headHeight * (idnumber - 1);
objbuttom = bodyHeight + headHeight * (idnumber - 2);
currenttop = parseInt(obj.style.top);
if (currenttop >= objbuttom)
{
countid = 1;
for(i=0;i<document.all.tags('div').length;i++)
if (document.all.tags('div')[i].id == 'item'+countid+'body')
{
obj = document.all.tags('div')[i];
objtop = headHeight * (countid - 1);
if (countid == idnumber)
{
moveup(obj,objtop,false);
break;
}
else
moveup(obj,objtop,true);
countid++;
}
}
else if ((currenttop >= objtop) && (idnumber < objcount))
{
idnumber++;
countid = objcount;
for(i=document.all.tags('div').length-1;i>=0;i--)
if (document.all.tags('div')[i].id == 'item'+countid+'body')
{
obj = document.all.tags('div')[i];
objbuttom = bodyHeight + headHeight * (countid - 2);
if (countid == idnumber)
{
movedown(obj,objbuttom,false);
break;
}
else
movedown(obj,objbuttom,true);
countid--;
}
}
}
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><style type='text/css'>
.headtd1 { background: #00A4E1; border: 1px outset; border-color: #00BBFF #0077FF #0077FF #00BBFF; cursor: hand; font-size: 9pt}.headtd2 { background: #20C1FF; border: 1px outset; border-color: #60D3FF #0077FF #0077FF #60D3FF; cursor: hand; font-size: 9pt}.bodytd { background: #99CCFF; border: 1px outset; border-color: #B0D8FF #0077FF #0077FF #B0D8FF; font-size: 9pt}</style>
</head><div id='mainboard' style='position:absolute; left:2px; top:2px; width:120px; height:334px; z-index:1; overflow: hidden; background: #99CCFF;'> <div id='item1body' style='position:absolute; left:0; top:0; width:120px; height:202px; z-index:2; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item1head' height='20' class='headtd2' onclick='showme(item1body,this)' align='center'>菜单1</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item2body' style='position:absolute; left:0; top:202; width:120px; height:202px; z-index:3; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item2head' height='20' class='headtd1' onclick='showme(item2body,this)' align='center'>菜单2</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item3body' style='position:absolute; left:0; top:224; width:120px; height:202px; z-index:4; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item3head' height='20' class='headtd1' onclick='showme(item3body,this)' align='center'>菜单3</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item4body' style='position:absolute; left:0; top:246; width:120px; height:202px; z-index:5; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item4head' height='20' class='headtd1' onclick='showme(item4body,this)' align='center'>菜单4</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item5body' style='position:absolute; left:0; top:268; width:120px; height:202px; z-index:6; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item5head' height='20' class='headtd1' onclick='showme(item5body,this)' align='center'>菜单5</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item6body' style='position:absolute; left:0; top:290; width:120px; height:202px; z-index:7; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item6head' height='20' class='headtd1' onclick='showme(item6body,this)' align='center'>菜单6</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div><div id='item7body' style='position:absolute; left:0; top:312; width:120px; height:202px; z-index:8; overflow: hidden'><table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item7head' height='20' class='headtd1' onclick='showme(item7body,this)' align='center'>菜单7</td></tr><tr><td class='bodytd' align='center'>test</td></tr>
</table>
</div>