滑动效果下拉导航菜单

下载地址

HTML

这个菜单是完全跨浏览器兼容的(耶!),所以可以使用圆角定义,而不需要担心他们会如何优雅地呈现在老式浏览器。#menuBarHolder { width: 730px; height:45px; background-color:#000; color:#fff; font-family:Arial; font-size:14px; margin-top:20px;}#menuBarHolder ul{ list-style-type:none; display:block;}#container { margin-top:100px;}#menuBar li{ float:left; padding:15px; height:16px; width:50px; border-right:1px solid #ccc; }#menuBar li a{color:#fff; text-decoration:none; letter-spacing:-1px; font-weight:bold;}.menuHover { background-color:#999;}.firstchild { border-left:1px solid #ccc;}.menuInfo { cursor:hand; background-color:#000; color:#fff;width:74px; font-size:11px;height:100px; padding:3px; display:none;position:absolute; margin-left:-15px; margin-top:-15px;-moz-border-radius-bottomright: 5px;-moz-border-radius-bottomleft: 5px;-webkit-border-bottom-left-radius: 5px;-webkit-border-bottom-right-radius: 5px;-khtml-border-radius-bottomright: 5px;-khtml-border-radius-bottomleft: 5px; border-radius-bottomright: 5px;border-radius-bottomleft: 5px;}最后,让我们看看jQuery的流体菜单。我们想添加悬浮情况下每个元素的菜单,这样当用户的鼠标滑过菜单项时,div的信息赋予优雅。为了实现这一点,我们只是将使用jQuery的内置slideDown和slideUp效果提供最有效的方式来达到我们想要的效果。我们也希望用户能够点击整个“li”元素,而不是内部的链接,所以我们要将pseduo-click事件绑定到所有菜单的document.location李的通过。href属性检查孩子的href链接。这是实现如下:$(document).ready(function(){ $("#menuBar li").click(function(){ var url = $(this).find("a").attr("href"); document.location.href = url; }); $("#menuBar li").hover(function(){ $(this).find(".menuInfo").slideDown();},function(){ $(this).find(".menuInfo").slideUp(); }); });这就是它!您现在可以轻松地设置附加信息的任何menu-bar菜单项,如果需要你可以轻松地扩展式菜单的长度以适应您的需要。

313_277b6ecc68b22d8965c0f4118b4cfa9f.jpg

dd:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值