当前路径: 星河码客 » 插件特效 » 滑动效果下拉导航菜单

滑动效果下拉导航菜单

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菜单项,如果需要你可以轻松地扩展式菜单的长度以适应您的需要。

滑动效果下拉导航菜单

在线演示        积分下载        6毛下载        砍两刀下载       

文件目录······
暂无数据
 猜你喜欢 更多»
 工具推荐 更多»