2

I'm trying to use Affix, but I have some problem: when I scroll down - my affix div partially disappears under the footer, here is a jsbin example and code. How can I prevent this?

data-offset-bottom="anynumber" - don't work.

Evgeny Samsonov
  • 2,730
  • 4
  • 19
  • 28
  • If you look at the docs on GetBootstrap.com they use the affix with a sidebar and footer and there's many settings in the script and there's css within the breakpoints too. Take that a part to learn how to accomplish what you want. Here's the script they wrote for that, notice the .bs-footer and then look at the css for that too. http://getbootstrap.com/docs-assets/js/application.js – Christina Jan 15 '14 at 16:24
  • The offset must be calculated like this example: http://bootply.com/102441 – Carol Skelly Jan 16 '14 at 13:08

1 Answers1

1

This looks more like a z-index problem. I believe you can fix this by applying higher z-index value to the .affix than the footer using CSS.

Example:

set z-index if not set

yourFooter { position:absolute/relative/fixed /* a positioning is a must */ ; z-index: 300 }

then simply add a higher z-index to the .affix div. It already has a fixed positioning so there's no need to set the position for this.

Notes: While calculating z-index, test it with everything first, make sure that the affix does not start appearing above your modals and others.

Hope this works.

Yousof K.
  • 1,374
  • 13
  • 23