日本黄色片在线视频|国模无码一区二区三区|大香伊蕉国产短视频69|99精品日韩欧美在线观看|极品夜晚无码av一区二区|亚洲综合无码一区二区三区|国产亚洲精aa在线观看香蕉|日本2018一道国产高清视频

當(dāng)前位置:首頁(yè) > 長(zhǎng)沙網(wǎng)站建設(shè) > 類式QQ菜單制作代碼 JS

類式QQ菜單制作代碼 JS

2415

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
var titleHeight = 22;    //標(biāo)題的高度
var bodyHeight = 160;    //菜單內(nèi)容項(xiàng)的高度
var groupcount = 4;      //組的個(gè)數(shù)
var step = 3;          //移動(dòng)速度
//顯示菜單的內(nèi)容
function showDiv(obj1, obj2)
{
    //以下循環(huán)為改變標(biāo)題的背景顏色
    for(i=0;i<document.all.tags("td").length;i++)
    {
      if (document.all.tags("td")[i].className == 'headtd')
       document.all.tags("td")[i].bgColor = '#cccc66';
    }
    obj2.bgColor = '#cccc66';
    moveme(obj1);
}
//移動(dòng)菜單內(nèi)容
function moveme(obj)
{
    idnumber = parseInt(obj.id.substr(4));
    objtop = titleHeight * (idnumber - 1);
    objbuttom = bodyHeight + titleHeight * (idnumber - 2);
    currenttop = parseInt(obj.style.top);
    if (currenttop >= objbuttom)
    {
      //檢驗(yàn)出每一個(gè)應(yīng)該向上移動(dòng)的層
      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 = titleHeight * (countid - 1);
        moveup(obj,objtop);
        if (countid == idnumber)
         break;
        countid++;
       }
      }
}
else if ((currenttop <= objtop) && (idnumber < groupcount))
{
  //檢驗(yàn)出每一個(gè)應(yīng)該向下移動(dòng)的層
  idnumber++;
  countid = groupcount;
  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 + titleHeight * (countid - 2);
    movedown(obj,objbuttom);
    if (countid == idnumber)
     break;
    countid--;
   }
  }
}
}
//向上移動(dòng)的方法
function moveup(obj,objtop)
{
    currenttop = parseInt(obj.style.top);
    if (currenttop > objtop)
    {
      obj.style.top = currenttop - step;
      window.setTimeout('moveup('+obj.id+','+objtop+')',1)
    }
}
//向下移動(dòng)的方法
function movedown(obj,objbuttom)
{
    currenttop = parseInt(obj.style.top);
    if (currenttop < objbuttom)
    {
      obj.style.top = currenttop + step;
      window.setTimeout('movedown('+obj.id+','+objbuttom+')',1)
    }
}
</script>
<style type="text/css">
<!--showme
.headtd {  border: 3px outset; border-color: #00bbFF #0007cc #0007cc #00aacc; cursor: hand; font-size: 10pt}
.bodytd {  background: gray; border: 2px outset; border-color: #00aaFF #0007cc #0007cc #00aacc; font-size: 10pt}
-->
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<div id="mainboard" style="position:absolute; left:2px; top:2px; width:120px; height:226px; z-index:3; overflow: hidden; background-color: #cccc66;">
  <div id="item1body" style="position:absolute; left:0; top:0; width:120px; height:160px; z-index:1; overflow: hidden">
    <table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0">
      <tr>
        <td id="item1head" height="20" class="headtd" onClick="showDiv(item1body,this)" bgcolor="#cccc66">
          <div align="center">第一級(jí)</div>
        </td>
    </tr>
    <tr>
        <td class="bodytd">
          <div align="center">123</div>
        </td>
    </tr>
  </table>
  </div>
  <div id="item2body" style="position:absolute; left:0px; top:160; width:120; height:160; z-index:2; overflow: hidden">
    <table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0">
      <tr>
        <td id="item2head" height="20" class="headtd" onClick="showDiv(item2body,this)" bgcolor="#cccc66">
          <div align="center">第二級(jí)</div>
        </td>
      </tr>
      <tr>
        <td class="bodytd">
          <div align="center">456</div>
        </td>
      </tr>
    </table>
    <p class="headtd"> </p>
  </div>
  <div id="item3body" style="position:absolute; left:0; top:182; width:120px; height:160; z-index:3">
    <table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0">
      <tr>
        <td id="item3head" height="20" class="headtd" onClick="showDiv(item3body,this)" bgcolor="#cccc66">
          <div align="center">第三級(jí)</div>
        </td>
      </tr>
      <tr>
        <td class="bodytd">
          <div align="center">789</div>
        </td>
      </tr>
    </table>
  </div>
  <div id="item4body" style="position:absolute; left:0; top:204; width:120px; height:160; z-index:4; overflow: hidden">
    <table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0">
      <tr>
        <td id="item4head" height="20" class="headtd" onClick="showDiv(item4body,this)" bgcolor="#cccc66">
          <div align="center">第四級(jí)</div>
        </td>
      </tr>
      <tr>
        <td class="bodytd">
          <div align="center">000</div>
        </td>
      </tr>
    </table>
  </div>
</div>
</body>
</html>


 

發(fā)表評(píng)論
◎歡迎參與討論,請(qǐng)?jiān)谶@里發(fā)表您的看法、交流您的觀點(diǎn)。

相關(guān)文章

2021年優(yōu)度成功簽約并完成泰坦凝膠官網(wǎng)

2021年優(yōu)度成功簽約并完成泰坦凝膠官網(wǎng)

此網(wǎng)站采用標(biāo)準(zhǔn)網(wǎng)站建設(shè)方案,PC+移動(dòng)自動(dòng)轉(zhuǎn)換模式,網(wǎng)站產(chǎn)品為一款火爆的微商產(chǎn)品,也是一款男性用品。...

備案與沒備案的新網(wǎng)站老域名為什么百度都不收錄?

備案與沒備案的新網(wǎng)站老域名為什么百度都不收錄?

現(xiàn)在互聯(lián)網(wǎng)越來越難做,百度的門檻越來越高,以前新網(wǎng)站上線提交后3天就會(huì)收錄,現(xiàn)在新網(wǎng)站上線每天提交還不一定會(huì)收錄,必須結(jié)合外鏈才有效。...

做好“著陸頁(yè)”,公司銷售業(yè)績(jī)將提升一大步

做好“著陸頁(yè)”,公司銷售業(yè)績(jī)將提升一大步

當(dāng)今,一個(gè)能在用戶尋找“返回”按鈕之前抓住用戶眼球的著陸頁(yè)比以往任何時(shí)候都更有商業(yè)價(jià)值。值得慶幸的是,一個(gè)好的著陸頁(yè)面的設(shè)計(jì)過程比以往更加容易把握,訣竅在于弄清楚實(shí)現(xiàn)這個(gè)非常重要的切入點(diǎn)所需的核心要素...

什么是關(guān)鍵詞?

什么是關(guān)鍵詞?

關(guān)鍵詞就是你向搜索引擎發(fā)出的一個(gè)指令,是讓搜索引擎幫助你查找相關(guān)信息的命令,它可以是一個(gè)字,也可以是一個(gè)詞、一句話、一個(gè)英字母、英文單詞、一個(gè)數(shù)字、一個(gè)符號(hào)等任何可以在搜索框中輸入的信息。...

什么樣的網(wǎng)站才是一個(gè)合格的SEO網(wǎng)站?

什么樣的網(wǎng)站才是一個(gè)合格的SEO網(wǎng)站?

在講網(wǎng)站之前還是來介紹一下什么是網(wǎng)站,因?yàn)檫@里的學(xué)員還有很多SEO初學(xué)者,網(wǎng)站就好比是我們?cè)谀硞€(gè)商場(chǎng)、某個(gè)小區(qū)開的一個(gè)店鋪,你做生意肯定是有一個(gè)店鋪的對(duì)吧,那么網(wǎng)站就是一個(gè)互聯(lián)網(wǎng)上的店鋪,是一個(gè)虛擬的...