zoukankan      html  css  js  c++  java
  • 【菜单】一 animate

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>无标题文档</title>
    </head>
    
    <body>
    <style type="text/css">
    body{ font:12px/1.5 arial;}
    ul,ol{ list-style:none;}
    .menu{ width:570px; margin:100px auto;}
    .menu li{ float:left; margin:0 2px;}
    .menu a{ position:relative; display:block; width:164px; height:36px; background:url(http://pic002.cnblogs.com/images/2012/382256/2012061217315787.gif) no-repeat; color:#000; text-align:center; line-height:36px;}
    .menu em{ position:absolute; top:-85px; left:-15px; display:none; width:200px; height:76px; background:url(http://pic002.cnblogs.com/images/2012/382256/2012061217320849.png) no-repeat; text-align:center; line-height:76px;}
    </style>
    <ul class="menu">
        <li><a href="" title="Go to homepage">Home</a></li>
        <li><a href="" title="Find out who I am">About</a></li>
        <li><a href="" title="Subscribe RSS feeds">Subscribe RSS</a></li>
    </ul>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script>
    $(function () {
        $('a').append('<em></em>');
        $('a').hover(
            function () {
                var tt = $(this).attr('title');
                $('em', this).text(tt);
                $('em', this).animate({opacity: 'show', top: '-75px'}, 'slow');            
            },
            function () {
                $('em', this).animate({opacity: 'hide', top: '-85px'}, 'fast');
            }
        );
    });
    </script>
    </body>
    </html>
  • 相关阅读:
    C++实现邮件群发的方法
    HTML5 Canvas彩色小球碰撞运动特效
    ListView灵活的用法
    Win10计算器在哪里?三种可以打开Win10计算器的方法图文介绍
    设置Textview最大长度,超出显示省略号
    jQuery页面顶部下拉广告
    C#截屏
    细数人们对安卓的误解
    javaScript系列:js中获取时间new Date()详细介绍
    C# 发送Http请求
  • 原文地址:https://www.cnblogs.com/jzm17173/p/2546660.html
Copyright © 2011-2022 走看看