Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop jittering on position:fixed; elements across mobile devices when scrolling

We have an ad stuck to the bottom of the browser using position:fixed.

This works expected with Chrome/Firefox browsers. When loaded on some mobiles (nearly all androids, old iPhones and most window phones) the ad moves - we can make this less janky with some css animation but its still not ideal.

A simple fiddle example. It does seem to have be worse on content heavy pages.

like image 377
roughcoder Avatar asked Sep 01 '25 22:09

roughcoder


1 Answers

Managed to sort it out by hardware accelerating the container.

I used transform: translateZ(0); within the class setting the fixed position.

like image 91
roughcoder Avatar answered Sep 03 '25 14:09

roughcoder