亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

用jQuery擴展自寫的 UI導航

 更新時間:2010年01月13日 22:58:04   作者:  
目前試了 jQuery 擴展的編寫有兩種。
復制代碼 代碼如下:

(function($){
    $.navs=function(){
        return $('#top_menu_bar > li').each(function(){
            $(this).hover(
                function(){
                    $(this).find('ul:eq(0)').show();
                },
                function(){
                    $(this).find('ul:eq(0)').hide();
                }
            );
        });
    };
})(jQuery);

上面是直接定義屬性。下面是種常見的方法:
復制代碼 代碼如下:

jQuery.extend({
    navs:function(){
        return $('#top_menu_bar > li').each(function(){
            $(this).hover(
                function(){
                    $(this).find('ul:eq(0)').show();
                },
                function(){
                    $(this).find('ul:eq(0)').hide();
                }
            );
        });
    }
});

調(diào)用測試下:
$.navs();
兩年前的野心今天終于實現(xiàn)了(噢,這是導航,不是頁簽(tabs)),小有成就感一把!

相關(guān)文章

最新評論