I am currently doing a parallax website theme. The background images need to be attached as fixed for certain 'div's and 'section's to avoid jquery indulging in everything. The problem was the background images of the tags below any animated item disappeared while the transformation is being done, only on Google Chrome. Remedy?
相关问题
- How to change default background color for TChromi
- Stop location updates when app terminate
- Is it possible to have a element transparent and s
- ios5 background management different from ios4?
- Background image not stretching fully
相关文章
- Listview background is grey on Droid 3
- Java fixed memory map
- Background-size doesn't work
- Parallax scrolling
- Making expandable fixed footer in Bootstrap 3?
- jQuery: Animate (fade) background-color or image i
- Flutter ranging beacons in background - Android 8.
- Android layout background xml texture
This one is late to party but an amazing discovery, as I can see mostly css framework users, Bootstrap, Foundation (others) , have issues, and I am sure many of you also have scroll to top js functions that show scroll to top button as user starts scrolling down ,
if you have anything like this ( Bootstrap has it built in )
or you are showing some element via ,
or you are adding any kind of element or element class with transition , on scroll down, via js ( animation.css, waypoints.js, velocity.js )
remove transition/class if possible from that element or recheck when that element appears in order to fix the choppy Chrome issue.
Add the
transform
property to your element with fixed background image. You can have any set position.https://jsfiddle.net/rkwpxh0n/2/
An update almost 5 years in the future... This still seems to be a problem with chrome. I've tried most of the solutions mentioned including adding:
and it is not fixing the stuttering issue. adding
background-attachment: scroll
takes away the parallax effect which is crucial to the UX of the site. The solution above that mentions adding a parent element is not changing anything for me. Any other ideas from people that have had this issue recently? I'm using Gatsby(React) on the front end.Same problem here. I had a sticky header using
position:fixed;
that flickered in PC Chrome 34. I tried the solutions in this thread,position:static;
in the parent broke other parts. But I know adding-webkit-transform: translate3d(0,0,0);
basically makes Chrome turn that html into a layer so that it won't get repainted. That worked for me.UPDATE
future-friendly answer is to use the
will-change
property to create a layer!W3 specs
CanIUse
MDN definition
And I'll be honest, this seems like a weird solution to fix the flicker, but in essence it makes the element a layer, same as translate3d().
For me the issue was the styles attach to the parent elements of the div who has the fixed background, I put
-webkit-backface-visibility: inherit;
to the two main parents of my fixed div.in my case I was using foundation off-canvas so it goes like this