惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Hacker News: Ask HN
Hacker News: Ask HN
S
Securelist
Security Latest
Security Latest
S
Schneier on Security
T
Threat Research - Cisco Blogs
Latest news
Latest news
Cyberwarzone
Cyberwarzone
A
Arctic Wolf
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
NISL@THU
NISL@THU
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
I
Intezer
T
The Exploit Database - CXSecurity.com
N
News and Events Feed by Topic
Simon Willison's Weblog
Simon Willison's Weblog
T
Tor Project blog
Blog — PlanetScale
Blog — PlanetScale
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CERT Recently Published Vulnerability Notes
The Hacker News
The Hacker News
月光博客
月光博客
WordPress大学
WordPress大学
博客园 - 叶小钗
Hugging Face - Blog
Hugging Face - Blog
美团技术团队
量子位
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cisco Blogs
博客园 - 三生石上(FineUI控件)
Google DeepMind News
Google DeepMind News
Project Zero
Project Zero
Webroot Blog
Webroot Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Application and Cybersecurity Blog
Application and Cybersecurity Blog
云风的 BLOG
云风的 BLOG
L
LINUX DO - 最新话题
Schneier on Security
Schneier on Security
Engineering at Meta
Engineering at Meta
www.infosecurity-magazine.com
www.infosecurity-magazine.com
aimingoo的专栏
aimingoo的专栏
D
Docker
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
宝玉的分享
宝玉的分享
T
Troy Hunt's Blog
L
Lohrmann on Cybersecurity
T
The Blog of Author Tim Ferriss
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
LangChain Blog

博客园 - fengyv

塑造职场影响力的五大法宝 怎样培养独挡一面的能力 数据结构 - 归并排序(merging sort) [分享]恼人的设计模式 Git使用总结 设计师整理的系统开发流程-简洁又有重点 JavaScript中的String对象 python高效解析日志入库 如何让js不产生冲突,避免全局变量的泛滥,合理运用命名空间 HTML CSS——margin和padding的学习 三层浅析及示例分析 C语言的代码内存布局详解 超级立方体小记 如何和项目经理沟通产品的交付? CentOS配置smaba与Windows共享文件 从测试员到测试负责人 项目团队中4种组员类型的相应管理方式 在软件项目管理中如何把时间估算的靠近真实值? 性能优化——算法优化
Javascript实现简单的下拉二级菜单
fengyv · 2014-06-14 · via 博客园 - fengyv

Posted on 2014-06-14 21:55  fengyv  阅读(312)  评论()    收藏  举报

    1. <span style="font-size:14px;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
    2. <html xmlns="http://www.w3.org/1999/xhtml">  
    3. <head>  
    4.     <meta http-equiv="content-type" content="texthtml;charset=utf-8">  
    5.     <title>Menu</title>  
    6.     <style type="text/css">  
    7.         #nav  
    8.         {  
    9.             list-style: none;  
    10.             text-align: center;  
    11.         }  
    12.         #nav li  
    13.         {  
    14.             float: left;  
    15.             width: 100px;  
    16.             color: white;  
    17.             background-color: #3E3E3E;  
    18.         }  
    19.         #menu  
    20.         {  
    21.             list-style: none;  
    22.             padding: 5px;  
    23.             display: none;  
    24.             margin-left: -5px;  
    25.             margin-top: -5px;  
    26.         }  
    27.         #menu li  
    28.         {  
    29.             background-color: #ccc;  
    30.             width: 100px;  
    31.             text-align: left;  
    32.             padding-left: 10px;  
    33.         }  
    34.         #menu li a:link  
    35.         {  
    36.             text-decoration: none;  
    37.             display: block;  
    38.         }  
    39.         #menu li a:hover  
    40.         {  
    41.             background-color:#3E3E3E;  
    42.             color: white  
    43.         }  
    44.     </style>  
    45. </head>  
    46. <body>  
    47.     <ul id="nav">  
    48.         <li class="child">数 据 库  
    49.             <ul id="menu">  
    50.                 <li><a href="http://blog.csdn.net/u011043843">MySQL</a></li>  
    51.                 <li><a href="http://blog.csdn.net/u011043843">SQL Server</a></li>  
    52.                 <li><a href="http://blog.csdn.net/u011043843">Oracle</a></li>  
    53.                 <li><a href="http://blog.csdn.net/u011043843">DB2</a></li>  
    54.             </ul>  
    55.         </li>  
    56.         <li class="child">前台脚本  
    57.             <ul id="menu">  
    58.                 <li><a href="http://blog.csdn.net/u011043843">JavaScript</a></li>  
    59.                 <li><a href="http://blog.csdn.net/u011043843">Ruby</a></li>  
    60.                 <li><a href="http://blog.csdn.net/u011043843">HTML</a></li>  
    61.                 <li><a href="http://blog.csdn.net/u011043843">Python</a></li>  
    62.             </ul>  
    63.         </li>  
    64.         <li class="child">后台脚本  
    65.             <ul id="menu">  
    66.                 <li><a href="http://blog.csdn.net/u011043843">PHP</a></li>  
    67.                 <li><a href="http://blog.csdn.net/u011043843">ASP</a></li>  
    68.                 <li><a href="http://blog.csdn.net/u011043843">ASP.NET</a></li>  
    69.                 <li><a href="http://blog.csdn.net/u011043843">JSP</a></li>  
    70.             </ul>  
    71.         </li>  
    72.     </ul>  
    73.     <script type="text/javascript">  
    74.         var lis = document.getElementById("nav").getElementsByTagName('li');  
    75.         var i = 0;  
    76.           
    77.         for( i = 0; i < lis.length; i++)  
    78.         {  
    79.             if(lis[i].className == "child")  
    80.             {  
    81.                 lis[i].onmouseover = function()  
    82.                 {  
    83.                     var ulObj1 = this.getElementsByTagName('ul')[0];  
    84.                     ulObj1.style.display = "block";  
    85.                     this.style.backgroundColor="#ccc";  
    86.                     this.style.color="black";  
    87.                 }  
    88.             }  
    89.   
    90.                 lis[i].onmouseout = function()  
    91.                 {  
    92.                     var ulObj1 = this.getElementsByTagName('ul')[0];   
    93.                     ulObj1.style.display = "none";  
    94.                     this.style.backgroundColor="#3E3E3E";  
    95.                     this.style.color="white";  
    96.                 }  
    97.         }  
    98.   
    99.     </script>  
    100. </body>  
    101. </html></span>