0

I noticed that no scripts or styles are updating while user scrolls a page. Unfortunately this causes menu with position: fixed and top: 0 to jump when Chrome Android hides address bar.

So, is there any way to force CSS updates while scrolling? Or is there any way to keep position: fixed, top: 0 block on the same height?

Solutions from 'Background..' theme aren't working for me. My problem is different - Chrome Android doesn't want to update a page while user scrolls it.

user64675
  • 482
  • 7
  • 25
  • Possible duplicate of [Background image jumps when address bar hides iOS/Android/Mobile Chrome](http://stackoverflow.com/questions/24944925/background-image-jumps-when-address-bar-hides-ios-android-mobile-chrome) – parker_codes Nov 01 '16 at 19:40
  • None of solutions from that page work for me – user64675 Nov 01 '16 at 20:55

1 Answers1

0

Maybe force a redraw by resizing it?

$(window).trigger('resize');

Look at this for more possible solutions.

Community
  • 1
  • 1
parker_codes
  • 3,267
  • 1
  • 19
  • 27
  • And where should I put this? While user scrolls the page none of CSS or even JS events are happening. But I need to redraw WHILE he scrolls the page. – user64675 Nov 01 '16 at 21:14
  • Well since I don't know how your code is structured, I can't say. But this is a recurring statement. You could also go for just JS - `window.onresize = function() { // do a load of stuff };` – parker_codes Nov 01 '16 at 21:22
  • Resize event isn't firing continuously while addres bar is hiding. It fires once it disappeared. And when that happens, my menu just jumps to the right position. – user64675 Nov 01 '16 at 21:27
  • Look at [this](http://stackoverflow.com/questions/3485365/how-can-i-force-webkit-to-redraw-repaint-to-propagate-style-changes). – parker_codes Nov 01 '16 at 21:31
  • `transform: translateZ(0)` fixes this problem, but creates another one - now menu size is broken, because transform creates an isolated context (so now instead of viewport size for `top: 0; bottom: 0` it uses sizes of parent element) – user64675 Nov 01 '16 at 22:22