×

Loading...
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务
Ad by
  • 推荐 OXIO 加拿大高速网络,最低月费仅$40. 使用推荐码 RCR37MB 可获得一个月的免费服务

我写了这个, 把源码存成 htm 文件就可以了

本文发表在 rolia.net 枫下论坛<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<TITLE>fdasfWeb Dev References</TITLE>
<style type="text/css" id="MyStyles">

/* MENUS.CSS */

BODY { font-family:&Euml;&Icirc;&Igrave;&aring;; font-size:70%; }
H1 { font-size:120%; font-style:italic; }

DIV#divMenuBar { background-color:#6699CC; }
TABLE#tblMenuBar TD { font-size:60%; color:white; padding:0px 5px 0px 5px; cursor:default; }
TABLE#tblMenuBar TD.clsMenuBarItem { font-weight:bold; cursor:hand; }

DIV.clsMenu {
font-size:90%; background-color:#6699CC;
position:absolute; visibility:hidden; width:130px;
padding:5px 5px 5px 8px; border-top:1 white solid;
}
DIV.clsMenu A { text-decoration:none; color:white; font-weight:bold; }
DIV.clsMenu A:hover { color:moccasin; }

BUTTON { font-family:&Euml;&Icirc;&Igrave;&aring;; font-size:100%; }
</style>
<SCRIPT LANGUAGE="JScript">


/* MENUS.JS */

var eOpenMenu = null;

function OpenMenu(eSrc,eMenu)
{
eMenu.style.left = eSrc.offsetLeft + divMenuBar.offsetLeft;
eMenu.style.top = divMenuBar.offsetHeight + divMenuBar.offsetTop;
eMenu.style.visibility = "visible";
eOpenMenu = eMenu;
}

function CloseMenu(eMenu)
{
eMenu.style.visibility = "hidden";
eOpenMenu = null;
}

function document.onmouseover()
{
var eSrc = window.event.srcElement;
if ("clsMenuBarItem" == eSrc.className)
{
eSrc.style.color = "moccasin";
var eMenu = document.all[eSrc.id.replace("tdMenuBarItem","divMenu")];
if (eOpenMenu && eOpenMenu != eMenu)
{
CloseMenu(eOpenMenu);
}
if (eMenu)
{
OpenMenu(eSrc,eMenu);
}
}
else if (eOpenMenu && !eOpenMenu.contains(eSrc) && !divMenuBar.contains(eSrc))
{
CloseMenu(eOpenMenu);
}
}

function document.onmouseout()
{
var eSrc = window.event.srcElement;
if ("clsMenuBarItem" == eSrc.className)
{
eSrc.style.color = "";
}
}

</SCRIPT>
</HEAD>
<BODY>
<H1>gggggggggggWeb Dev References</H1>
<DIV ID="divMenuBar">
<TABLE ID="tblMenuBar" BORDER="0">
<TR>
<TD CLASS="clsMenuBarItem" ID="tdMenuBarItemDHTML">DHTML</TD>
<TD CLASS="clsMenuBarItem" ID="tdMenuBarItemCSS">CSS</TD>
<TD CLASS="clsMenuBarItem" ID="tdMenuBarItemXML DOM">XML DOM</TD>
<TD CLASS="clsMenuBarItem" ID="tdMenuBarItemXSL">XSL</TD>
</TR>
</TABLE>
</DIV>
<DIV CLASS="clsMenu" ID="divMenuDHTML">
<DIV CLASS="clsMenuSpacer"></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/objects.asp">fdasf</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/properties.asp">fda</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/methods.asp">fdas</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/events.asp">fdas</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/collections.asp">fdsa</A></DIV>
</DIV>
<DIV CLASS="clsMenu" ID="divMenuCSS">
<DIV CLASS="clsMenuSpacer"></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp">fdafdsa</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/css/reference/lengthunits.asp">fdasfd</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/colors/colors.asp">fdasfdsa</A></DIV>
</DIV>
<DIV CLASS="clsMenu" ID="divMenuXML DOM">
<DIV CLASS="clsMenuSpacer"></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/XMLGuide/default.asp">fdasfdasf</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/reference/scriptref/XMLDOM_Objects.asp">fdsafdsa</A></DIV>
</DIV>
<DIV CLASS="clsMenu" ID="divMenuXSL">
<DIV CLASS="clsMenuSpacer"></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/XSLGuide/default.asp">fdasfsa</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/reference/xsl/XSLElements.asp">fdasfa</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/reference/xsl/xslmethods.asp">fdasfa</A></DIV>
<DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/reference/xsl/XSLPatternSyntax.asp">fdasfda</A></DIV>
</DIV>
<P>
<BUTTON ONCLICK="window.alert(document.body.innerHTML);">aaaaaaaa HTML</BUTTON></P>
</BODY>
</HTML>更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / 各位JS大侠,哪里有比较多快好省的JavaScript的demo网站?我想找些例子。。。。谢谢了。
    • check out here
      • 多谢!!
    • 这个不错 http://artrambler.myetang.com/html/bcyj/javascript/javascript-sljc/0.html
    • More =>
    • 谢谢各位,缩小范围吧,我就是想做个在左边有个可伸缩自如的菜单,就是CollapsibleList
      • FYI
      • 我写了这个, 把源码存成 htm 文件就可以了
        本文发表在 rolia.net 枫下论坛<HTML>
        <HEAD>
        <META http-equiv="Content-Type" content="text/html; charset=UTF-16">
        <TITLE>fdasfWeb Dev References</TITLE>
        <style type="text/css" id="MyStyles">

        /* MENUS.CSS */

        BODY { font-family:&Euml;&Icirc;&Igrave;&aring;; font-size:70%; }
        H1 { font-size:120%; font-style:italic; }

        DIV#divMenuBar { background-color:#6699CC; }
        TABLE#tblMenuBar TD { font-size:60%; color:white; padding:0px 5px 0px 5px; cursor:default; }
        TABLE#tblMenuBar TD.clsMenuBarItem { font-weight:bold; cursor:hand; }

        DIV.clsMenu {
        font-size:90%; background-color:#6699CC;
        position:absolute; visibility:hidden; width:130px;
        padding:5px 5px 5px 8px; border-top:1 white solid;
        }
        DIV.clsMenu A { text-decoration:none; color:white; font-weight:bold; }
        DIV.clsMenu A:hover { color:moccasin; }

        BUTTON { font-family:&Euml;&Icirc;&Igrave;&aring;; font-size:100%; }
        </style>
        <SCRIPT LANGUAGE="JScript">


        /* MENUS.JS */

        var eOpenMenu = null;

        function OpenMenu(eSrc,eMenu)
        {
        eMenu.style.left = eSrc.offsetLeft + divMenuBar.offsetLeft;
        eMenu.style.top = divMenuBar.offsetHeight + divMenuBar.offsetTop;
        eMenu.style.visibility = "visible";
        eOpenMenu = eMenu;
        }

        function CloseMenu(eMenu)
        {
        eMenu.style.visibility = "hidden";
        eOpenMenu = null;
        }

        function document.onmouseover()
        {
        var eSrc = window.event.srcElement;
        if ("clsMenuBarItem" == eSrc.className)
        {
        eSrc.style.color = "moccasin";
        var eMenu = document.all[eSrc.id.replace("tdMenuBarItem","divMenu")];
        if (eOpenMenu && eOpenMenu != eMenu)
        {
        CloseMenu(eOpenMenu);
        }
        if (eMenu)
        {
        OpenMenu(eSrc,eMenu);
        }
        }
        else if (eOpenMenu && !eOpenMenu.contains(eSrc) && !divMenuBar.contains(eSrc))
        {
        CloseMenu(eOpenMenu);
        }
        }

        function document.onmouseout()
        {
        var eSrc = window.event.srcElement;
        if ("clsMenuBarItem" == eSrc.className)
        {
        eSrc.style.color = "";
        }
        }

        </SCRIPT>
        </HEAD>
        <BODY>
        <H1>gggggggggggWeb Dev References</H1>
        <DIV ID="divMenuBar">
        <TABLE ID="tblMenuBar" BORDER="0">
        <TR>
        <TD CLASS="clsMenuBarItem" ID="tdMenuBarItemDHTML">DHTML</TD>
        <TD CLASS="clsMenuBarItem" ID="tdMenuBarItemCSS">CSS</TD>
        <TD CLASS="clsMenuBarItem" ID="tdMenuBarItemXML DOM">XML DOM</TD>
        <TD CLASS="clsMenuBarItem" ID="tdMenuBarItemXSL">XSL</TD>
        </TR>
        </TABLE>
        </DIV>
        <DIV CLASS="clsMenu" ID="divMenuDHTML">
        <DIV CLASS="clsMenuSpacer"></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/objects.asp">fdasf</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/properties.asp">fda</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/methods.asp">fdas</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/events.asp">fdas</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/collections.asp">fdsa</A></DIV>
        </DIV>
        <DIV CLASS="clsMenu" ID="divMenuCSS">
        <DIV CLASS="clsMenuSpacer"></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp">fdafdsa</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/css/reference/lengthunits.asp">fdasfd</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/workshop/author/dhtml/reference/colors/colors.asp">fdasfdsa</A></DIV>
        </DIV>
        <DIV CLASS="clsMenu" ID="divMenuXML DOM">
        <DIV CLASS="clsMenuSpacer"></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/XMLGuide/default.asp">fdasfdasf</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/reference/scriptref/XMLDOM_Objects.asp">fdsafdsa</A></DIV>
        </DIV>
        <DIV CLASS="clsMenu" ID="divMenuXSL">
        <DIV CLASS="clsMenuSpacer"></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/XSLGuide/default.asp">fdasfsa</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/reference/xsl/XSLElements.asp">fdasfa</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/reference/xsl/xslmethods.asp">fdasfa</A></DIV>
        <DIV><A TARGET="_new" HREF="http://msdn.microsoft.com/xml/reference/xsl/XSLPatternSyntax.asp">fdasfda</A></DIV>
        </DIV>
        <P>
        <BUTTON ONCLICK="window.alert(document.body.innerHTML);">aaaaaaaa HTML</BUTTON></P>
        </BODY>
        </HTML>更多精彩文章及讨论,请光临枫下论坛 rolia.net