4

I don't know why but when you have the CSS style overflow-x:hidden on the body element then the affix plugin does not work. It simply refuses to switch between affix, affix-top and affix bottom.

I'm guessing it fails to detect or measure the scroll position but I have no idea why overflow-x:hidden could be causing this.

Unfortunately I need overflow-x:hidden so removing it is not a good work-around.

Any ideas on how/where to look?

kjhughes
  • 106,133
  • 27
  • 181
  • 240
Le-roy Staines
  • 2,037
  • 2
  • 22
  • 40

1 Answers1

1

Judging by the age of your post, you resolved your issue a different way. But I just came across the same problem and found a solution so will post it here for anybody else who is experiencing the same problem:

The affix function indeed breaks when html, body {overflow-x:hidden;} is set.

But if you use html .container, body .container {overflow-x:hidden;} in your CSS instead, it works perfectly and there is no horizontal scrolling on the mobile.

You will have to put this CSS into a media query to apply it only to mobile though.

pixelnik
  • 26
  • 3