频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

给大家演示个QQ菜单

来源:qqread 作者:佚名 出处:巧巧读书 2008-04-24 进入讨论组

    <html>
    <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 = 4;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>
    </script>
    <style type='text/css'>
    .headtd1 {  background: #00A4E1; border: 2px outset; border-color: #00BBFF #0017dF #0017dF #00BBFF; cursor: hand; font-size: 9pt}.headtd2 {  background: #20C1FF; border: 2px outset; border-color: #60D3FF #007600 #007600 #60D3FF; cursor: hand; font-size: 9pt}.bodytd  {  background: #99CCFF; border: 2px outset; border-color: #B0D8FF #003223 #003223 #B0D8FF; font-size: 9pt}</style>
    </head>
    <body bgcolor='#FFFFFF' text='#000000'>
    <div id='mainboard' style='position:absolute; left:2px; top:2px; width:120px; height:268px; 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'>文章上传</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'>相册管理</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'>文章分类</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'>访问统计</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table></div></div></body></html>

    效果如何:

给大家演示个QQ菜单

更多文章 更多内容请看QQ病毒QQ个性签名汇总QQ表情专题,或进入讨论组讨论。
收藏此文】【 】【打印】【关闭
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
巧巧读书宗旨
相关专题
讨论组问题推荐
站内各频道最新更新文档
站内最新制作专题
热门关键字导读
Photoshop教 程照片处理 照片制作 PS快捷键 抠图
计 算 机 故 障XP系统修复
艺 术 与 设 计设计 流媒体 设计欣赏 边框
计 算 机 安 全ARP
站内频道文章精选
巧巧电脑频道编辑信箱  告诉我们您想看的专题或文章