jquery 遮罩层效果实现的导航菜单

发布时间:2019-09-25编辑:脚本学堂
分享一例jquery实现的导航菜单,使用了jquery的遮罩层效果,只要悬停在导航栏的区域,将展示一个明亮的菜单在稍显黑暗的背景图中脱颖而出。有需要的朋友参考下吧。

 
本节内容:
jquery遮罩层实现导航菜单,利用明暗效果来突出当前用户的操作。

完整代码:
 

复制代码 代码示例:
/**
* 遮罩层效果 导航菜单
* by www.jb200.com
*/
$(function() {
var $oe_menu= $('#oe_menu');
var $oe_menu_items= $oe_menu.children
('li');
var $oe_overlay= $('#oe_overlay');
                $oe_menu_items.bind('mouseenter',function(){
var $this = $(this);
$this.addClass('slided selected');
$this.children('div').css('z-
index','9999').stop(true,true).slideDown(200,function(){
$oe_menu_items.not
('.slided').children('div').hide();
$this.removeClass('slided');
});
}).bind('mouseleave',function(){
var $this = $(this);
$this.removeClass('selected').children
('div').css('z-index','1');
});
$oe_menu.bind('mouseenter',function(){
var $this = $(this);
$oe_overlay.stop(true,true).fadeTo(200,
0.6);
$this.addClass('hovered');
}).bind('mouseleave',function(){
var $this = $(this);
$this.removeClass('hovered');
$oe_overlay.stop(true,true).fadeTo(200,
0);
$oe_menu_items.children('div').hide();
})
});

>>> 您可能感兴趣的文章:
鼠标滑过导航条改变背景图的jquery实现代码
jQuery Mobile 导航栏代码一例
jquery下拉菜单 jquery文字导航效果
jQuery导航条背景切换效果的实现代码(图文)
jquery 导航菜单代码(兼容IE6,IE7,FF等)