Position fixed on chrome mobile causing element to move on scroll up/down
For some reason, my Google Chrome on mobile required minimum-scale=1
in the viewport <meta/>
.
<meta name="viewport" content="minimum-scale=1"/>
Fixed element Y position calculated wrong after scroll on chrome for android
The bug seems to be related to hammer.js:
https://github.com/hammerjs/hammer.js/issues/1171
Full page fixed background jumps when scrolling because of the bottom bar on mobile
Finally, I found a solution, here is my solution.
HTML
<body>
<div id="bg"></div>
CONTENT...
</body>
CSS
#bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
z-index: -1;
transform: scale(1.0);
&:after {
content: "";
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url("path");
background-position: center;
background-size: cover;
background-repeat: no-repeat;
}
}
Related Topics
How to Make The Animation Smooth
CSS Grid: Grid-Row Not Working in Chrome Browser
Linear-Gradient Using CSS3 Pie in Ie9 Not Working, Ie8 Does
CSS Dynamic Responsive Column Layout
Fixed Position Not Working in Safari 7
Image Shifting/Jumping After CSS Transition Effect with Scale Transform in Firefox
How to Output HTML Form Data to Pdf
Ipad Mini Specfic CSS Media Queries
How to Strongly Force Line-Height in CSS, with No Stretches
CSS Relative Positioning with Negative Value and Height
"_Msg_@@Extension_Id_" Doesn't Work and Webfonts Don't Load
CSS Transition Fade in Only for Element
Media Query to Differentiate Desktop from iPad in Landscape Mode
Using CSS Modules How to Define a Global Class