!
也想出现在这里? 联系我们
广告位

[代码样式]一个很酷的jQuery动画菜单

[代码样式]一个很酷的jQuery动画菜单

使用方法

引入文件

<script src="https://www.dowebok.com/js/jquery.min.js"></script>
<script src="https://www.dowebok.com/js/animate-bg.js"></script>

除了 jQuery 文件外,还需要引入 animate-bg.js 文件,这是一个让背景有动画效果的插件。

HTML

<div id="container">
    <ul id="nav">
        <li><a href="#" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" >首 页</a></li>
        <li><a href="#" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" >关 于</a></li>
        <li><a href="#" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" >链 接</a></li>
        <li><a href="#" rel="external nofollow"  rel="external nofollow"  rel="external nofollow"  rel="external nofollow" >联 系</a></li>
    </ul>
</div>

CSS

body, div, h1, h2, h3, h4, h5, h6, p, ul, ol, li, dl, dt, dd, img, form {
    margin: 0;
    padding: 0;
    border: 0;
}
body {
    background: #f5f0e0 url(images/noise.png);
}
#container {
    height: 800px;
    background: url(images/bg.jpg) center top no-repeat;
}
ul#nav {
    width: 700px;
    margin: 0 auto;
    text-align: center;
    overflow: hidden;
}
ul#nav li {
    float: left;
    list-style: none;
}
ul#nav li a {
    display: block;
    width: 97px;
    height: 77px;
    padding: 72px 0 0 0;
    margin: 0 32px 0 32px;
    font: bold 16px Helvetica, Arial, Sans-Serif;
    text-transform: uppercase;
    color: #9c5959;
    text-shadow: 0 1px 3px #c4bda6;
    text-decoration: none;
    background: url(images/label.png) 0 -149px no-repeat;
}
ul#nav li a:hover {
    background: url(images/label.png) 0 0 no-repeat;
    color: #eee9d9;
    text-shadow: 0 2px 3px #4c2222;
}
ul#nav li a.js:hover {
    background: url(images/label.png) 0 -149px no-repeat;
}

JavaScript

$(function() {
    $("#nav li a").addClass("js");
    $("#nav li a").hover(function () {
        $(this).stop(true,true).animate({backgroundPosition:"(0 0)"}, 200);
        $(this).animate({backgroundPosition:"(0 -5px)"}, 150);
    }, function () {
        $(this).animate({backgroundPosition:"(0 -149px)"}, 200);
    });
});

[b2_file link="

百度网盘" name="一个很酷的jQuery动画菜单" pass="" code=""]

给TA打赏
共{{data.count}}人
人已打赏
脚本代码

[代码样式]jQuery缩略图插件jQuery-Fakecrop

2020-11-20 15:02:26

脚本代码

[代码样式]jQuery图片黑白开关插件BlackAndWhite

2020-11-20 15:02:28

下载说明

  • 1、微码盒所提供的压缩包若无特别说明,解压密码均为weimahe.com
  • 2、下载后文件若为压缩包格式,请安装7Z软件或者其它压缩软件进行解压;
  • 3、文件比较大的时候,建议使用下载工具进行下载,浏览器下载有时候会自动中断,导致下载错误;
  • 4、资源可能会由于内容问题被和谐,导致下载链接不可用,遇到此问题,请到文章页面进行反馈,以便微码盒及时进行更新;
  • 5、其他下载问题请自行搜索教程,这里不一一讲解。

站长声明

本站大部分下载资源收集于网络,只做学习和交流使用,版权归原作者所有;若为付费资源,请在下载后24小时之内自觉删除;若作商业用途,请到原网站购买;由于未及时购买和付费发生的侵权行为,与本站无关。本站发布的内容若侵犯到您的权益,请联系本站删除,我们将及时处理!
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索