📄 qqmenu.js
字号:
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)
{
//**alert("当前moveup,false" + i + ":" + obj.id + ":" + objtop + " ~ " + objbuttom + " -> " + obj.style.top);
moveup(obj, objtop ,false);
break;
}
else
{
//**alert("其它moveup,true," + i + ":" + obj.id + ":" + objtop + " ~ " + objbuttom + " -> " + obj.style.top);
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)
{
//**alert("当前down,false," + i + ":" + obj.id + ":" + objtop + " ~ " + objbuttom + " -> " + obj.style.top);
movedown(obj,objbuttom,false);
break;
}
else
{
//**alert("其他down,false," + i + ":" + obj.id + ":" + objtop + " ~ " + objbuttom + " -> " + obj.style.top);
movedown(obj,objbuttom,true);
}
countid--;
}
}
else
// 最后一条在最上面,点击应该保持不动,但好像死掉了,点击其他的也不能动了。原来是moving状态保持在ismove。把moving改成false就解决问题了
moving = false;
}
function moveup(obj,objtop,ismove)
{
currenttop = parseInt(obj.style.top);
if (currenttop > objtop)
{
// ************* modified by zhouqiufang on 2003-1-13 begin
// 判断currenttop减去step后是否会小于objtop,
// 如果不超过,则继续递归,否则就到objtop为止
// 原来只考虑step值为1的情况,但在某些机器上会导致很多次的递归调用引起堆栈溢出
//obj.style.top = currenttop - step;
if (currenttop - step > objtop)
obj.style.top = currenttop - step;
else
{
obj.style.top = objtop;
//return;
}
// ************* modified by zhouqiufang on 2003-1-13 end
moveup(obj, objtop, ismove);
//setTimeout('moveup('+obj.id+','+objtop+','+ismove+')',1);
return;
}
moving = ismove;
}
function movedown(obj,objbuttom,ismove)
{
currenttop = parseInt(obj.style.top);
if (currenttop < objbuttom)
{
// ************* modified by zhouqiufang on 2003-1-14 begin
// 判断currenttop增加step后是否会超过objbottom,
// 如果不超过,则继续递归,否则就到objbottom为止
// 原来只考虑step值为1的情况,但在某些机器上会导致很多次的递归调用引起堆栈溢出
//obj.style.top = currenttop + step;
if (currenttop + step < objbuttom)
obj.style.top = currenttop + step;
else
{
obj.style.top = objbuttom;
//return;
}
// ************* modified by zhouqiufang on 2003-1-14 end
movedown(obj,objbuttom,ismove);
//setTimeout('movedown('+obj.id+','+objbuttom+','+ismove+')',1);
return;
}
moving = ismove;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -