zoukankan      html  css  js  c++  java
  • 这个jQuery导航菜单怎么样

    效果体验:
    http://keleyi.com/keleyi/phtml/jqtexiao/39.htm

    HTML文件代码:

    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>jQuery鼠标悬停上下滑动导航条 - 柯乐义</title><base target="_blank" />
    <link href="http://keleyi.com/keleyi/phtml/jqtexiao/39/hovertreedaohang.css" rel="stylesheet" type="text/css" />
    <script src="http://hovertree.com/ziyuan/jquery/jquery-1.11.3.min.js"></script>
    <script>
    $(document).ready(function() {
    $("#hovertreecaidan li a").wrapInner( '<span class="out"></span>' );
    $("#hovertreecaidan li a").each(function() {
    $( '<span class="over">' + $(this).text() + '</span>' ).appendTo( this );
    });
    $("#hovertreecaidan li a").hover(function() {
    $(".out",    this).stop().animate({'top':    '48px'},    300); // move down - hide
    $(".over",    this).stop().animate({'top':    '0px'},     300); // move down - show
    }, function() {
    $(".out",    this).stop().animate({'top':    '0px'},     300); // move up - show
    $(".over",    this).stop().animate({'top':    '-48px'},    300); // move up - hide
    });
    });
    </script>
    </head>
    <body>
    <div id="hovertreecaidan" class="hovertreedaohang">
    <ul>
    <li><a href="http://keleyi.com">首 页</a></li>
    <li><a href="http://keleyi.com/menu/jquery/">jQuery</a></li>
    <li><a href="http://keleyi.com/menu/webqd/">Web前端</a></li>
    <li><a href="http://keleyi.com/menu/javascript/">Javascript</a></li>
    <li><a href="http://keleyi.com/menu/html5/">HTML5</a></li>
    <li><a href="http://hovertree.com/">HoverTree</a></li>
    <li><a href="http://hovertree.com/texiao/">网页特效</a></li>
    <li><a href="http://tool.keleyi.com/">工具</a></li>
    <li><a href="http://hovertree.com/guestbook/">留言</a></li>
    </ul>
    <div class="hvtclear"></div>
    </div> 
    </body>
    </html>

    其中jQuery的wrapInner() 方法使用指定的 HTML 内容或元素,来包裹每个被选元素中的所有内容 (inner HTML)。

    参考:http://hovertree.com/hvtart/bjae/m66osaoc.htm

    web前端资源:http://www.cnblogs.com/jihua/p/webfront.html

  • 相关阅读:
    <!--[if IE 9]>....<!end if-->
    背景颜色设置
    UIImageView 响应UIButton的点击事件
    响应键盘return事件
    iOS 封装数据请求,解析数据(异步)
    UIImageView 圆角
    JS 控制文本框必须输入值才能查询
    MVC4 @Html.Raw()
    JS加成显示
    随机生成人物名称
  • 原文地址:https://www.cnblogs.com/jihua/p/jquerydaohang.html
Copyright © 2011-2022 走看看