温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

CSS jquery圆角带阴影的导航菜单代码分享

发布时间:2020-08-11 08:52:30 来源:ITPUB博客 阅读:130 作者:shanshuiboy 栏目:移动开发
  • CSS jquery制作实现的导航菜单效果,用户交互做的不错,当鼠标放在菜单上时,菜单背景悬停豪华,仔细看,本款菜单的文字还有阴影效果,菜单项的修饰同样有阴影效果,这种阴影让本款菜单的立体感有着很不错的视觉效果。本款菜单适合做网站的一级导航,并没有设计二级子菜单,企业站、公司站比较适合使用。

点击(此处)折叠或打开

  1. <html>
  2. <head>
  3. <title>导航条效果- www.codesc.net </title>
  4. <style>
  5. .navigation{
  6.     position:relative;
  7.     margin:0 auto;
  8.     width:915px;
  9. }
  10. ul.menu{
  11.     list-style:none;
  12.     font-family:"微软雅黑";
  13.     border-top:1px solid #bebebe;
  14.     margin:0px;
  15.     padding:0px;
  16.     float:left;
  17. }
  18. ul.menu li{
  19.     float:left;
  20. }
  21. ul.menu li a{
  22.     text-decoration:none;
  23.     background:#2d83db url(http://www.codesc.net/jscode/demoimg/201602/bgMenu.png) repeat-x top left;
  24.     padding:15px 0px;
  25.     width:128px;
  26.     color:#333333;
  27.     float:left;
  28.     text-shadow: 0 1px 1px #fff;
  29.     text-align:center;
  30.     border-right:1px solid #a1a1a1;
  31.     border-left:1px solid #e8e8e8;
  32.     font-weight:bold;
  33.     font-size:15px;
  34.     -moz-box-shadow: 0 1px 3px #555;
  35.     -webkit-box-shadow: 0 1px 3px #555;
  36. }
  37. ul.menu li a.hover{
  38.     background-image:none;
  39.     color:#fff;
  40.     text-shadow: 0 -1px 1px #000;
  41. }
  42. ul.menu li a.first{
  43.     -moz-border-radius:0px 0px 0px 10px;
  44.     -webkit-border-bottom-left-radius: 10px;
  45.     border-left:none;
  46. }
  47. ul.menu li a.last{
  48.     -moz-border-radius:0px 0px 10px 0px;
  49.     -webkit-border-bottom-right-radius: 10px;
  50. }
  51. ul.menu li span{
  52.     width:64px;
  53.     height:64px;
  54.     background-repeat:no-repeat;
  55.     background-color:transparent;
  56.     position:absolute;
  57.     z-index:-1;
  58.     top:80px;
  59.     cursor:pointer;
  60. }
  61. </style>
  62. </head>
  63. <style>
  64. body { margin:0px; padding:0px; background-color:#f0f0f0;}
  65. </style>
  66. <body>
  67. <div class="navigation">
  68.   <ul class="menu" id="menu">
  69.     <li><span class="ipod"></span><a href="" class="first">网站源码</a></li>
  70.     <li><span class="video_camera"></span><a href="">CSS特效</a></li>
  71.     <li><span class="television"></span><a href="">菜单模板</a></li>
  72.     <li><span class="monitor"></span><a href="">圆角菜单</a></li>
  73.     <li><span class="toolbox"></span><a href="">菜单代码</a></li>
  74.     <li><span class="telephone"></span><a href="">手机菜单</a></li>
  75.     <li><span class="print"></span><a href="" class="last">菜单动画</a></li>
  76.   </ul>
  77. </div>
  78. <script type="text/javascript" src="http://www.codesc.net/ajaxjs/jquery-1.9.1.min.js"></script>
  79. <script type="text/javascript">
  80. $(function() {
  81.     var d=1000;
  82.     $('#menu span').each(function(){
  83.         $(this).stop().animate({
  84.             'top':'-17px'
  85.         },d+=250);
  86.     });
  87.     $('#menu > li').hover(
  88.     function () {
  89.         var $this = $(this);
  90.         $('a',$this).addClass('hover');
  91.         $('span',$this).stop().animate({'top':'40px'},300).css({'zIndex':'10'});
  92.     },
  93.     function () {
  94.         var $this = $(this);
  95.         $('a',$this).removeClass('hover');
  96.         $('span',$this).stop().animate({'top':'-17px'},800).css({'zIndex':'-1'});
  97.     }
  98. );
  99. });
  100. </script>
  101. </body>
  102. </html>
引用自原文:http://www.codesc.net/jscss/3332.shtml

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI