Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Navigation 页面滚动上的粘性导航_Navigation_Sticky - Fatal编程技术网

Navigation 页面滚动上的粘性导航

Navigation 页面滚动上的粘性导航,navigation,sticky,Navigation,Sticky,我一直在尝试实现粘性导航,类似于mashable.com 我在这方面取得了一定的成功,因为我的粘性导航突然变得不可见,然后在到达顶部时重新出现 你可以在这里看到它 我的js如下所示: var $document = $(document), $element = $('.column_title_container'); $document.scroll(function() { if ($document.scrollTop() > 330) {

我一直在尝试实现粘性导航,类似于mashable.com 我在这方面取得了一定的成功,因为我的粘性导航突然变得不可见,然后在到达顶部时重新出现

你可以在这里看到它

我的js如下所示:

var $document = $(document),
    $element = $('.column_title_container');

    $document.scroll(function() {
    if ($document.scrollTop() > 330)
    {
        jQuery('.fixed_column_title_container').css({'visibility': 'visible'});
    } else {
        jQuery('.fixed_column_title_container').css({'visibility': 'hidden'});
    }
    });

没关系,我通过将css可见性更改为位置来修复它