⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄

📁 看到的网络上的一个源码
💻
📖 第 1 页 / 共 4 页
字号:
#colors TD {
	PADDING-RIGHT: 0pt; PADDING-LEFT: 0pt; FONT-SIZE: 1pt; PADDING-BOTTOM: =
0pt; MARGIN: 0pt; WIDTH: 10pt; PADDING-TOP: 0pt; HEIGHT: 10pt
}

------=_NextPart_000_0000_01C78FE2.0502F810
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
Content-Location: http://liuren.donews.com/js/coolmenus.js

    var childActive =3D null =0A=
    var menuActive =3D null=0A=
    var lastHighlight =3D null=0A=
    var active =3D false=0A=
   =0A=
    function getReal(el) {=0A=
      temp =3D el=0A=
      while ((temp!=3Dnull) && (temp.tagName!=3D"TABLE") && =
(temp.className!=3D"root") && (temp.id!=3D"menuBar")) {=0A=
        if (temp.tagName=3D=3D"TD")=0A=
          el =3D temp=0A=
        temp =3D temp.parentElement=0A=
      }=0A=
      return el=0A=
    }=0A=
=0A=
function raiseMenu(el) {=0A=
/*el.style.borderLeft   =3D "1px solid buttonhighlight";=0A=
el.style.borderRight  =3D "1px solid buttonshadow";=0A=
el.style.borderTop    =3D "1px solid buttonhighlight";=0A=
el.style.borderBottom =3D "1px solid buttonshadow";=0A=
*/=0A=
el.style.backgroundColor =3D "#a7a7a7"=0A=
el.style.color =3D "#ffffff"=0A=
    }=0A=
=0A=
function clearHighlight(el) {=0A=
      if (el=3D=3Dnull) return=0A=
      /*el.style.borderRight =3D "1px buttonface solid"=0A=
      el.style.borderBottom =3D "1px buttonface solid"=0A=
      el.style.borderTop =3D "1px buttonface solid"=0A=
      el.style.borderLeft =3D "1px buttonface solid" =0A=
      */=0A=
      el.style.backgroundColor =3D "#666666"=0A=
      el.style.color =3D "white"=0A=
    }=0A=
=0A=
function sinkMenu(el) {=0A=
      /*el.style.borderRight =3D "1px #EEEEEE solid"=0A=
      el.style.borderBottom =3D "1px #EEEEEE solid"=0A=
      el.style.borderTop =3D "1px gray solid"=0A=
      el.style.borderLeft =3D "1px gray solid"=0A=
      */=0A=
      el.style.color =3D "white"=0A=
    }=0A=
=0A=
    function menuHandler(menuItem) {=0A=
      // Write generic menu handlers here!=0A=
      // Returning true collapses the menu. Returning false does not =
collapse the menu=0A=
      return true=0A=
    }=0A=
=0A=
    function getOffsetPos(which,el,tagName) {=0A=
      var pos =3D 0 // el["offset" + which]=0A=
      while (el.tagName!=3DtagName) {=0A=
        pos+=3Del["offset" + which]=0A=
        el =3D el.offsetParent=0A=
      }=0A=
      return pos	=0A=
    }=0A=
=0A=
    function getRootTable(el) {=0A=
      el =3D el.offsetParent=0A=
      if (el.tagName=3D=3D"TR") =0A=
        el =3D el.offsetParent=0A=
      return el=0A=
    }=0A=
=0A=
    function getElement(el,tagName) {=0A=
      while ((el!=3Dnull) && (el.tagName!=3DtagName) )=0A=
        el =3D el.parentElement=0A=
      return el=0A=
    }=0A=
=0A=
    function processClick() {=0A=
      var el =3D getReal(event.srcElement)=0A=
      if ((getRootTable(el).id=3D=3D"menuBar") && (active)) {        =0A=
        cleanupMenu(menuActive)=0A=
        clearHighlight(menuActive)=0A=
        active=3Dfalse=0A=
        lastHighlight=3Dnull=0A=
        doHighlight(el)=0A=
      }=0A=
      else {=0A=
        if ((el.className=3D=3D"root") || (!menuHandler(el)))=0A=
          doMenuDown(el)=0A=
        else {=0A=
          if (el._childItem=3D=3Dnull) =0A=
            el._childItem =3D getChildren(el)=0A=
          if (el._childItem!=3Dnull)  return;=0A=
          if ((el.id!=3D"break") && (el.className!=3D"disabled") && =
(el.className!=3D"disabledhighlight") && (el.className!=3D"clear"))  {=0A=
            if (menuHandler(el)) {=0A=
              cleanupMenu(menuActive)=0A=
              clearHighlight(menuActive)=0A=
              active=3Dfalse=0A=
              lastHighlight=3Dnull=0A=
            }=0A=
          }=0A=
        }=0A=
      }=0A=
    }=0A=
=0A=
    function getChildren(el) {=0A=
      var tList =3D el.children.tags("TABLE")=0A=
      var i =3D 0=0A=
      while ((i<tList.length) && (tList[i].tagName!=3D"TABLE"))=0A=
        i++=0A=
      if (i=3D=3DtList.length)=0A=
        return null=0A=
      else=0A=
        return tList[i]=0A=
    }=0A=
=0A=
    function doMenuDown(el) {=0A=
      if (el._childItem=3D=3Dnull) =0A=
        el._childItem =3D getChildren(el)=0A=
      if ((el._childItem!=3Dnull) && (el.className!=3D"disabled") && =
(el.className!=3D"disabledhighlight")) {=0A=
        // Performance Optimization - Cache child element=0A=
        ch =3D el._childItem=0A=
        if (ch.style.display=3D=3D"block") {=0A=
          removeHighlight(ch.active)=0A=
          return=0A=
        }=0A=
        ch.style.display =3D "block"=0A=
        if (el.className=3D=3D"root") {=0A=
          ch.style.pixelTop =3D el.offsetHeight + el.offsetTop + 2=0A=
          ch.style.pixelLeft =3D el.offsetLeft + 1=0A=
	  if (ch.style.pixelWidth=3D=3D0)=0A=
            ch.style.pixelWidth =3D ch.rows[0].offsetWidth+10   // +50=0A=
          sinkMenu(el)=0A=
          active =3D true=0A=
          menuActive =3D el=0A=
        } else {=0A=
          childActive =3D el=0A=
          ch.style.pixelTop =3D getOffsetPos("Top",el,"TABLE") -3 // =
el.offsetTop + el.offsetParent.offsetTop - 3=0A=
          ch.style.pixelLeft =3D el.offsetLeft + el.offsetWidth=0A=
	  if (ch.style.pixelWidth=3D=3D0)=0A=
            ch.style.pixelWidth =3D ch.offsetWidth+10  // +50=0A=
        }     =0A=
      }=0A=
    }=0A=
 =0A=
    function doHighlight(el) {=0A=
      el =3D getReal(el)=0A=
      if ("root"=3D=3Del.className) {=0A=
        if ((menuActive!=3Dnull) && (menuActive!=3Del)) {=0A=
          clearHighlight(menuActive)=0A=
        }=0A=
        if (!active) {=0A=
          raiseMenu(el)=0A=
        }          =0A=
        else =0A=
          sinkMenu(el)=0A=
        if ((active) && (menuActive!=3Del)) {=0A=
          cleanupMenu(menuActive)          =0A=
          doMenuDown(el)=0A=
        }=0A=
        menuActive =3D el  =0A=
        lastHighlight=3Dnull=0A=
      }=0A=
      else {=0A=
        if (childActive!=3Dnull) =0A=
          if (!childActive.contains(el)) =0A=
            closeMenu(childActive, el)    =0A=
=0A=
        if (("TD"=3D=3Del.tagName) && ("clear"!=3Del.className)) {=0A=
          var ch =3D getRootTable(el)         =0A=
          if (ch.active!=3Dnull) {=0A=
            if (ch.active!=3Del) {=0A=
              if (ch.active.className=3D=3D"disabledhighlight")  =0A=
                ch.active.className=3D"disabled"=0A=
              else=0A=
                ch.active.className=3D""=0A=
              }=0A=
            }=0A=
          ch.active =3D el=0A=
          lastHighlight =3D el=0A=
          =0A=
          if ((el.className=3D=3D"disabled") =
||(el.className=3D=3D"disabled1")|| =
(el.className=3D=3D"disabledhighlight") || (el.id=3D=3D"break")) =0A=
            =0A=
            el.className =3D "disabledhighlight"=0A=
            =0A=
          else {=0A=
            if (el.id!=3D"break") {=0A=
              el.className =3D "highlight"=0A=
              if (el._childItem=3D=3Dnull) =0A=
                el._childItem =3D getChildren(el)=0A=
              if (el._childItem!=3Dnull) {=0A=
                doMenuDown(el)=0A=
              }=0A=
            }  =0A=
          }=0A=
        }=0A=
      }=0A=
    }=0A=
=0A=
    function removeHighlight(el) {=0A=
      if (el!=3Dnull)=0A=
        if ((el.className=3D=3D"disabled") || =
(el.className=3D=3D"disabledhighlight"))  =0A=
          el.className=3D"disabled"=0A=
        else=0A=
          el.className=3D""=0A=
    }=0A=
=0A=
    function cleanupMenu(el) {=0A=
      if (el=3D=3Dnull) return=0A=
      for (var i =3D 0; i < el.all.length; i++) {=0A=
        var item =3D el.all[i]=0A=
        if (item.tagName=3D=3D"TABLE")=0A=
         item.style.display =3D ""=0A=
        removeHighlight(item.active)=0A=
        item.active=3Dnull=0A=
      }=0A=
    }=0A=
=0A=
=0A=
    function closeMenu(ch, el) {=0A=
      var start =3D ch=0A=
      while (ch.className!=3D"root") {=0A=
          ch =3D ch.parentElement=0A=
          if (((!ch.contains(el)) && (ch.className!=3D"root"))) {=0A=
            start=3Dch=0A=
          }=0A=
      }=0A=
      cleanupMenu(start)=0A=
    }=0A=
 =0A=
    function checkMenu() {=0A=
    	      =0A=
      if (document.all.menuBar=3D=3Dnull) return=0A=
      if ((!document.all.menuBar.contains(event.srcElement)) && =
(menuActive!=3Dnull)) {=0A=
        clearHighlight(menuActive)=0A=
        closeMenu(menuActive)=0A=
        active =3D false=0A=
        menuActive=3Dnull=0A=
        choiceActive =3D null=0A=
      }=0A=
    }=0A=
=0A=
    function doCheckOut() {=0A=
      var el =3D event.toElement      =0A=
      if ((!active) && (menuActive!=3Dnull) && =
(!menuActive.contains(el))) {=0A=
        clearHighlight(menuActive)=0A=
        menuActive=3Dnull=0A=
      }=0A=
    }=0A=
=0A=
=0A=
    function processKey() {=0A=
      if (active) {=0A=
        switch (event.keyCode) {=0A=
         case 13: lastHighlight.click(); break;=0A=
         case 39:  // right=0A=
           if ((lastHighlight=3D=3Dnull) || =
(lastHighlight._childItem=3D=3Dnull)) {=0A=
             var idx =3D menuActive.cellIndex=0A=
//             if (idx=3D=3DmenuActive.offsetParent.cells.length-2)=0A=
             if (idx=3D=3DgetElement(menuActive,"TR").cells.length-2)=0A=
               idx =3D 0=0A=
             else=0A=
               idx++=0A=
             newItem =3D getElement(menuActive,"TR").cells[idx]=0A=

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -