0

我正在使用Bootstrap 文档中使用的 Bootstrap 词缀侧导航。如您所见,当视口小于 768px 并且页面正在切换到移动视图时,scrollspy 没有任何意义。因此,我想在页面切换到移动视图后立即停用 scrollspy。请记住,修复应仅适用于侧边栏导航,而不适用于导航栏。想法,有人吗?

4

1 回答 1

2

修复很容易。使用媒体查询并定义位置:静态;用于移动视图的侧边栏导航 div,例如

    @media (max-width: 767px){

   .sidenav.affix {         /* change sidenav selector to match your layout */   

    position: static;    /* removes the affix behaviour */
    width: auto;         /* customise as required */
    top: 0;               /* customise as required */
    }  
    }
于 2013-07-03T12:06:50.543 回答