Bootstrap affix always jumps

I want to use the bootstrap affix plugin in the sidebar. However, since my site is responsive, it always jumps to some dimensions, and I cannot get it to work properly. I tried the solutions listed here: How to use the new affix plugin in the twitter 2.1.0 boot file? but it doesn’t just work.

Here is a demo

I know how to do this on a fixed-width site, but since my site it also responds with bootable documents, and since it works fine there , how can I achieve the same effect?

Since it probably will never work

.affix { position: fixed; top: 20px; right: 10%; } 
+4
source share
1 answer

When I used this, my .affix class just has position:fixed , nothing else. The top position at which the affix element becomes attached can be set in the affix() method using the offset parameter, for example

 $("#nav_id").affix({ offset: 400 }); 
+1
source

All Articles