bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Scrollspy - Issues with 100% body height in FF/Opera

Open drainpip opened this issue 13 years ago • 12 comments

I have included a jsfiddle with a basic example of the issue. When using 100% height on the body, Firefox breaks up using scrollspy. Unfortunately for me, my design requires a sticky footer.

  • Works in Chrome / IE / Safari
  • Broken in FF / Opera
  • Removing 100% body height fixes issue
  • Tested in latest version of each browser

Here is the jsfiddle: http://jsfiddle.net/drainpip/mGWVy/

drainpip avatar Jan 07 '13 18:01 drainpip

Nice catch. i can reproduce the same on my mac from the jsfiffle and from live customer website :/ Hope will have a fix soon

boulox avatar Jan 09 '13 23:01 boulox

I was able to get it to work 95% using this commit from @P2000

https://github.com/P2000/bootstrap/commit/7e286a7f5cd7ddee7409ba15eacfb70e33ca6c2d

This, however, creates the problem if the section ID isn't long enough to match up with the side nav the li won't addClass active. I'll keep this solution on my build at least temporarily until I can think up anything else to do or abandon it for another solution.

drainpip avatar Jan 17 '13 21:01 drainpip

I just added this into my JS to make the top of the section always hit the top of the viewport on pages using scrollspy with an affixed menu.

https://gist.github.com/4560823

drainpip avatar Jan 17 '13 23:01 drainpip

just don't use it with height 100% on the body

fat avatar Feb 08 '13 04:02 fat

So you mean you can't use a sticky footer together with scrollspy? Even the Bootstrap example for a sticky footer uses 100% height on the body: http://twitter.github.com/bootstrap/examples/sticky-footer.html

raphaotten avatar Feb 08 '13 09:02 raphaotten

agree +1 to reopen the issue. Until 100% height on body is required for sticky footer. Scrollspy should support it.

I believe scroll spy is not a widely use plugin and here you reduce again the ability to use it from already a small amount of people could be interesting at using it. It's start to be a pretty useless...

boulox avatar Feb 08 '13 12:02 boulox

Even though the devs have no interest in fixing it, the hacks listed above do work if your project requires both.

drainpip avatar Feb 08 '13 15:02 drainpip

+1 for reopen! or are you really just telling us "you're scrolling it wrong"? ;-)

wolfgangrittner avatar Mar 09 '13 11:03 wolfgangrittner

It'd be nice to see this resolved, please reopen.

Unless there's an alternative for Sticky Footers.

Gorgoroth avatar Mar 19 '13 07:03 Gorgoroth

https://github.com/twitter/bootstrap/issues/5007#issuecomment-14896304

There's an easy way to update it. I am using this + https://gist.github.com/4560823 to get the effect I want.

drainpip avatar Mar 22 '13 23:03 drainpip

The patch from #7315 (applied to 2.3.2) fixes the problem for me in Firefox (while it still works correctly in other browsers).

noniq avatar May 23 '13 15:05 noniq

Good to hear, I can confirm it's working for me in 2.3.2. I'll be testing BS3 beta soon if it was committed there too.

drainpip avatar May 23 '13 21:05 drainpip