栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

js+css实现导航效果实例

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

js+css实现导航效果实例

本文实例讲述了js+css实现导航效果的方法。分享给大家供大家参考。具体实现方法如下:

1. 程序代码如下:

复制代码 代码如下:  
 
 
 
CSS+JS实现兼容性很好的无限级下拉菜单 
 
*{ margin:0; padding:0; border:0;} 
body{font:12px/130% verdana,geneva,arial,helvetica,sans-serif,宋体;}li{list-style:none;} 
.clearfix:after{content:" ";display:block;height:0;clear:both;visibility:hidden;}.clearfix{display:inline-block;} 
a:link{ color:#000; text-decoration:none; } 
a:visited{ color:#000; text-decoration:none; } 
a:hover{ color:#000; text-decoration:none; } 
.menu{ width:778px; height:26px; background:#fff; margin:0 auto;} 
.menusel{ float:left;width:100px; position:relative; height:25px; background:#ddd; line-height: 25px; margin-left: 1px; *margin-left: 0px;_margin-left: -1px;} 
.menusel h2{ font-size:12px; } 
.menusel a{ display: block;text-align:center; width:100px;border:1px solid #a4a4a4; height:25px; border-bottom:1px solid #a4a4a4; position:relative; z-index:2;} 
.menusel a:hover{ border:1px solid #a4a4a4; border-bottom:1px dashed #eeeeee; position:relative; z-index:2; height:25px;} 
.ahover a{border-bottom:1px dashed #eeeeee; background:#eeeeee; } 
.position{ position:absolute; z-index:1;} 
.menusel ul{width:125px; background:#eee; border:1px solid #a4a4a4; margin-top: -1px; position:relative; z-index:1; display:none;} 
.menusel .block{ display:block;} 
.typeul li{border-bottom:1px dashed #a4a4a4;width:125px; position:relative; float:left; } 
.typeul li a{ border:none;width:125px; } 
.typeul li a:hover{ border:none; background:#ddd;} 
.typeul{  margin-left:0;  } 
.typeul ul{left:125px; top:0; position:absolute;} 
.fli{ margin-left: -1px; border-left:#eeeeee solid 1px;} 
.menusel .lli{ border:none; } 
 
 
 
 
 
  
  菜单1 
    
   

     
        
  • 菜单选项1-2
  •  
        
  •  
          菜单选项1-2 
         
       
            
    • 菜单选项1-2-1
    •  
            
    • 菜单选项1-2-2
    •  
           
     
        
  •  
        
  • 菜单选项1-2
  •  
        
  • 菜单选项1-2
  •  
       
 
    
   
   
  菜单2 
   
 
     
     
  • 菜单选项2-2
  •  
     
  • 菜单选项2-2 
     
       
       
    • 菜单选项2-2-1
    •  
       
    • 菜单选项2-2-2 
       
         
         
      • 菜单选项2-2-1
      •  
         
      • 菜单选项2-2-2 
         
      •  
         
       
       
    •  
       
     
     
  •  
     
  • 菜单选项2-2
  •  
     
  • 菜单选项2-2
  •  
     
 
   
   
   
  菜单3 
   
 
     
     
  • 菜单选项3-2
  •  
     
  • 菜单选项3-2 
     
       
       
    • 菜单选项3-2-1
    •  
       
    • 菜单选项3-2-2 
       
         
         
      • 菜单选项3-2-1
      •  
         
      • 菜单选项3-2-2 
         
           
           
        • 菜单选项3-2-1
        •  
           
        • 菜单选项3-2-2
        •  
           
         
         
      •  
         
       
       
    •  
       
     
     
  •  
     
  • 菜单选项3-2
  •  
     
  • 菜单选项3-2
  •  
     
 
   
  
 
  
 

2. 程序效果

希望本文所述对大家的javascript程序设计有所帮助。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/103998.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号