运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
x
 
1
<!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
        <title>jquery hover顶部导航栏菜单
5
        </title>
6
        <script type="text/javascript" src="http://ku.shouce.ren/libs/jquery/1/jquery1.8.0.min.js">
7
        </script>
8
    </head>
9
    <body>
10
        <div class="hd-main clearfix" id="header">
11
            <a class="logo" href="">
12
            </a>
13
            <div class="navs">
14
                <a class="def-nav" href="">主页
15
                </a>
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
xxxxxxxxxx
349
 
1
@charset "utf-8";
2
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td,figure{
3
  margin:0;
4
  padding:0}
5
html{
6
  background-color:#e9ecec}
7
table{
8
  table-layout:fixed;
9
  border-collapse:collapse}
10
section,article,aside,header,footer,nav,dialog,figure{
11
  display:block}
12
.clearfix:after{
13
  content:"\20";
14
  display:block;
15
  height:0;
JS代码
复制 格式化 注释 注释 清空
放大
xxxxxxxxxx
13
 
1
$(document).ready(function(){
2
  $(".def-nav,.info-i").hover(function(){
3
    $(this).find(".pulldown-nav").addClass("hover");
4
    $(this).find(".pulldown").show();
5
  }
6
                              ,function(){
7
    $(this).find(".pulldown").hide();
8
    $(this).find(".pulldown-nav").removeClass("hover");
9
  }
10
                             );
11
}
12
                 );
13
名称
很酷的网页顶部图标菜单 右上角下拉菜单
分类
菜单导航
描述
兼容IE和火狐的顶部菜单栏,带图标的图文菜单,还有右上角的下拉导航效果,一个演示包括了两种菜单,都是很实用的效果,只使用了jquery就实现了。如果你的网站上此前用有jquery插件,那么整合起来就更方便了,点击运行可预览菜单效果。
收藏