bootstrap-affix.js: using Chrome, affixed menu moves violently up and down each time one scrolls to the bottom of page
I'm using Chrome version 21 and Mac OS X 10.7.
I don't have this same problem on Firefox 14, Safari 6, or Opera 12.
Did you try to style the .affix-bottom? I had a similar jumpy experience with my affixed
@MichalKopec thanks, so the menu div gets the affix JS and a separate footer div gets the .affix-bottom class? might you explain in code what you mean?
The bottom bound can fix this, yes. Also, margin on the bottom of an element can cause the jumping, so double check that.
just to be clear, the behavior I observed was on the twitter bootstrap site itself, not my own html.
@tim-peterson weird, i can't reproduce this (and i have an identical setup). What page are you seeing this on? fullscreen? etc?
http://twitter.github.com/bootstrap/javascript.html, scroll down all the way to the bottom using Chrome 21.0.1180.82, not fullscreen.
the affix menu,<ul class="nav nav-list bs-docs-sidenav affix-bottom">, goes berserk because the classes affix-bottom and affix get toggled rapidly.
Same issue here on a custom implementation. Classes affix and affix-bottom get toggled rapidly while scrolling (and the affixed element exceeds the desired bottom offset). Using this:
$('.title').affix({ offset: { top: 350, bottom: 1500 } })
I'm not seeing this at all and have the same version of Chrome.
maybe its just a Mac trackpad issue, i'm using OS X 10.7.4 and have my system preferences->trackpad "Tracking speed" set to the 4th tickmark out of 10 (going left to right).
Btw, sorry to keep wasting your time on this, its not a big deal to me personally but can't hurt to have a record of this issue for others.
I am also experiencing this issue, though I am on Windows 7. I experienced this issue in Chrome and Firefox. I believe at one point I had it functioning properly but through editing further this flickering behavior began to happen. I suppose there may be an error in my code, but if it is happening to others as well perhaps there is a bug.
I am also experiencing this issue. I'm really stuck here. I can't figure out what is going wrong. But I have an additional problem with absolute positioning. The toggling of the affix and affix-bottom classes are sequential and not random. Here's what I've found so far (and my code):
Live Example
http://phaseone.me/internets/github_issues/bootstrap/4647/prod/Printed-Tags.html
The JS
// DYNAMIC SUBNAV
// --------------
$('#subnav-list').affix({
offset: {
top: function() {
brw = $(window).width();
if (brw >= 1200) return 114;
// Still need to include other widths
},
bottom: 171
}
});
The HTML
The whole page: https://gist.github.com/3517294
Here's a screencap of the relevant section: http://grab.bovie.me/fJhS
The CSS
#subnav-list.affix-bottom {
position: absolute;
top: auto;
bottom: 126px;
}
#subnav-list {
width: 240px;
padding: 15px;
margin: 30px 0 0 0;
}
#subnav-list.affix {
top: 50px;
position: fixed
}
The other problem
Instead of the nav-list positioning itself to the page, it is somehow relevant to .subnav. Despite having the style the same as the bootstrap docs, it's positioned wrong.
With .affix-bottom:
> $('#subnav-list').offset().top
76
With .affix:
> $('#subnav-list').offset().top
2574
@phaseOne , weird i'm not seeing this issue on your site though I'm still seeing it on the twitter bootstrap site.
Having the same issue with custom implementation. Any updates on this issue? It would be really important for me.
I'm having this issue as well.
I figured out that the main problem is when the "affix" and "affix-bottom" CSS classes are toggled the CSS on the element are also changing aswell. And the jumpy experience caused because the top and bottom properties are changing from "auto" to a fix value.
For example in my case:
.affix { position: fixed; top: 40px; bottom: auto; } .affix-bottom { position: fixed; top: auto; bottom: 595px; }
If I give a fix value for both classes it won't jump anymore but in my case for the bottom class I would need a negative top value because my element is higher than the avalaible space I have for it in my layout. That negative top value should be calculated by the plugin..
You guys should fix this, i have faith in you bros
@fat since you aren't working at Twitter are you also not working on Bootstrap anymore? Regardless, what will you be up to now?
I'm just curious as someone who is eternally grateful for your and Mark's colossal contribution to the community,
I had the same issue and i made a patch for it,
https://github.com/vaionicle/bootstrap/commit/8a74ad7b888d1f3d07845d36ddb65d0914eeec32
try it and let me know if it is working.
Patch doesn't work for me. Now the nav toggles between affix-top and affix-bottom rapidly.
I'm using Mac OS X 10.8.1, Firefox 15.0 and Chrome 21.0.1180.89. This patch works fine. https://github.com/kzxtreme/bootstrap/commit/be411d8256b2512b0bec1b9478c58b3618fc3806