p277ieonly_improved_menus.htm

来自「javascript source code part2」· HTM 代码 · 共 44 行

HTM
44
字号
<HTML>
   <BODY>
      <STYLE TYPE="text/css">
         #menu1 { position: absolute; clip: rect(auto auto 16 auto) }
         #item  { background-color: red }
      </STYLE>

      <SCRIPT>
         function   pick(obj) { obj.style.backgroundColor="yellow"; return true; }
         function unpick(obj) { obj.style.backgroundColor="red"; return true;}
      </SCRIPT>

      <STRONG>
         <PRE>
            <DIV id="menu1"
                 ONMOUSEOVER="this.style.clip = 'rect(auto auto auto auto)'"
                 ONMOUSEOUT ="this.style.clip = 'rect(auto auto 16 auto)'">
               <SPAN ID="item">File  </SPAN>
               <SPAN ID="item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>
               <SPAN ID="item" ONMOUSEOVER="pick(this)" ONMOUSEOUT="unpick(this)">
                  Open&nbsp;
               </SPAN>
               <SPAN ID="item" ONMOUSEOVER="pick(this)" ONMOUSEOUT="unpick(this)">
                  Edit&nbsp;
               </SPAN>
               <SPAN ID="item" ONMOUSEOVER="pick(this)"
                     ONMOUSEOUT="unpick(this)">Export</SPAN>
               <SPAN ID="item" ONMOUSEOVER="pick(this)"
                     ONMOUSEOUT="unpick(this)">Import</SPAN>
               <SPAN ID="item" ONMOUSEOVER="pick(this)" ONMOUSEOUT="unpick(this)">
                  Save&nbsp;
               </SPAN>
               <SPAN ID="item">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>
               <SPAN ID="item" ONMOUSEOVER="pick(this)" ONMOUSEOUT="unpick(this)">
                  Exit&nbsp;
               </SPAN>
            </DIV>
         </PRE>
      </STRONG>
   </BODY>
</HTML>


⌨️ 快捷键说明

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