解讀 M$ 原始碼:JavaScript + CSS 實現動態菜單顯示

來源:互聯網
上載者:User
<!--解讀 M$ 原始碼:JavaScript + CSS 實現動態菜單顯示-->
<!--Default.htm-->
<!--小弟的 JavaScript 水平實在有夠差勁,故以下註解均為個人理解,有疏漏及不當之處還請各位大蝦指正-->
<!--以下原始碼來源於 M$ Windows 2000 Professional 安裝光碟片的 DISCOVER/EASY2USE 目錄,更改之處見文檔的最後註解-->
<!--有關“單位”與“集合”的定義,請參見文檔後面的註解-->
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
        <TITLE>更易使用</TITLE><!--注1-->
        <SCRIPT language="javascript">
var whichIm;
var varColor = "DDEEFF";
document.onmouseover = mouseOver;
document.onmouseout = mouseOut;
document.onmousedown = mouseDown;
document.onmouseup = mouseUp;
function mouseOver() {
    var vSrc = window.event.srcElement;
    if (vSrc.className == "child2" || vSrc.className == "child3" || vSrc.className == "parent")/*判斷對象是否為“單位”*/ {
    fColor = vSrc.style.backgroundColor;
    vSrc.style.backgroundColor = varColor;
    /*注2*/
    }
}
function mouseOut() {
    var vSrc = window.event.srcElement;
    if (vSrc.className == "child2" || vSrc.className == "child3" || vSrc.className == "parent") {
    vSrc.style.backgroundColor = fColor;
    /*注2*/
    }
}
function mouseDown() {
    var vSrc = window.event.srcElement;
    divColl=document.all.tags("DIV");

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.