Twitter bootstrap 如何向引导添加徽标';附加导航

Twitter bootstrap 如何向引导添加徽标';附加导航,twitter-bootstrap,nav,affix,Twitter Bootstrap,Nav,Affix,当用户滚动时,我试图将我的站点徽标的较小版本添加到Bootstrap的附加导航栏中 这是我的名片 这就是我到目前为止一直在做的。。。我试着用较小的徽标添加到nav.affix中,但没有效果。我走对了吗 #nav.affix { position: fixed; top: 0; width: 100%; z-index:10; background: rgb(255, 255, 255) transparent; background: rgba(255, 255, 255, 0.8); } #n

当用户滚动时,我试图将我的站点徽标的较小版本添加到Bootstrap的附加导航栏中

这是我的名片

这就是我到目前为止一直在做的。。。我试着用较小的徽标添加到nav.affix中,但没有效果。我走对了吗

#nav.affix {
position: fixed;
top: 0;
width: 100%;
z-index:10;
background: rgb(255, 255, 255) transparent;
background: rgba(255, 255, 255, 0.8);
}
#nav #nav-img {
background-image:url(http://static.tumblr.com/bw1wxme/rOYn2c6na/logo-small.jpg);
}
#nav.affix #nav-img {
display:inline-block;
}
#sidebar.affix-top {
position: static;
}
#sidebar.affix {
position: fixed;
top: 180px;
}

这里是

看起来你可以用几种不同的方法来做

您可能想尝试一下以下建议:

编辑:

您可以在javascript中执行以下操作:

$(window).scroll(function(){
   var height = $(this).scrollTop();
   var brand = $("#brand");
   if (height > 100){
     brand.show();   
   }
   else{
      brand.hide();
   }
});
我已经用一些更改更新了您的JSFIDLE:
它不能完全与包含的布局一起工作,但它能满足您的期望。我在您的html中添加了一个div,其中包含Brand的id和类。然后我将背景设置为徽标的url。默认情况下,我还将其设置为隐藏。当您滚动时,当您向上滚动到顶部时,徽标应该会出现和消失。

我希望在用户开始滚动后,徽标会出现在导航栏上