製作jquery遮罩層效果導覽功能表代碼

來源:互聯網
上載者:User

 我們將建立一個簡單的jquery菜單,只要我們懸停在導覽列的地區裡,將展示給我們的畫面是:明亮的菜單在稍顯黑暗的背景圖中脫穎而出

jquery導航是一個網站必不可少的模組,當一個使用者在一個網站上瀏覽的時候,為了某個目的而查看網站導覽列的時候,突出導覽列的效果是重中之重。因此必須要使用一個效果:jquery遮罩層。利用明暗效果來突出目前使用者的操作。  代碼如下:$(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();})});

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.