6

在使用 affix 属性后,我试图阻止我的右侧 div 向左移动。

任何 iudea 我如何做到这一点。您可以在这里看到问题,请向下滚动:-

http://monkeygetnews.jonathanlyon.com/bs.html

谢谢

乔纳森

4

1 回答 1

9

激活后,scroll spy 添加类词缀和位置:固定到它正在监视的 div。这种定位使 div 脱离正常流动,结果是它向左浮动。

解决方案是添加一些 CSS 样式以将其浮动到您想要的位置。在您的页面中,我认为它会是这样的:

.span3.affix{
position: fixed; /* to stop the div from scrolling */
top: 0;          /* to fix the div at the top its containing element */
right: 0;        /* to fix the div at the right of its containing element */
}

您可能需要稍微尝试一下才能将其放置在您想要的位置。重要的是,一旦您知道选择器(在这种情况下)是 .span3.affix,它就很容易使用。

祝你好运!

于 2013-01-27T04:28:37.717 回答