使用 HTML 和 jQuery 创建相同类型的导航

Creating the same kind of navigation with HTML & jQuery

本文关键字:同类型 导航 创建 HTML jQuery 使用      更新时间:2023-09-26

Stackoverflow的你好人,

我希望构建与网站 Pagekit.com 上使用的相同的导航。滚动一会儿后必须弹出导航。有人知道jQuery插件或其他可以为我解决问题的东西吗?我已经做了一些谷歌搜索,但找不到任何有用的东西。

此致敬意迪伦

关键是:scrollPosition。

你想要达到的结果有点太多了,无法解释你必须采取的每一个行动。以下是您要查找的内容的示例: 滚动时淡入

$(document).ready(function() {
    /* Every time the window is scrolled ... */
    $(window).scroll( function(){
        /* Check the location of each desired element */
        $('.hideme').each( function(i){
            var bottom_of_object = $(this).position().top + $(this).outerHeight();
            var bottom_of_window = $(window).scrollTop() + $(window).height();
            /* If the object is completely visible in the window, fade it it */
            if( bottom_of_window > bottom_of_object ){
                $(this).animate({'opacity':'1'},500);
            }
        }); 
    });
});