Flashing Background Image on Transition
See original GitHub issueApplying the basic glide setup with slides that contain a background image causes a flicker when transitioning.
<div class="glide" id="glide-header">
<div class="glide__track" data-glide-el="track">
<ul class="glide__slides">
<li class="glide__slide FOO">A</li>
<li class="glide__slide FOO">B</li>
</ul>
</div>
</div>
(Not sure if the background image is necessary, but relevant to my repro)
/* import core css for glide */
.FOO {
background-image: url('../img/foo.png');
}
const Carousel = new Glide('#glide-header',
Object.assign({}, glideConfig, {
perView: 1,
gap: 0,
autoplay: 5000,
hoverpause: false,
}));
Carousel.mount();
If you let the slides play through, you’ll notice a flicker on Chrome (minimally).
I was able to fix this issue by overriding glide__slides as seen below. Any idea what might be happening here?
.glide__slide {
/* Fix for flashing background image on slide */
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:8
Top Results From Across the Web
Webkit: Flicker on CSS Transition with background image
The background of the .main container flickers on the CSS transition in all webkit browsers. Any of the solutions out there like: -webkit-backface-visibility ......
Read more >Flickering when background image changes : r/Frontend
I want to make an animated background on my website. I decided to achieve that with css keyframe animation. The problem is flickering...
Read more >How can I prevent flicker in a reactive background image ...
I have a div whose background image changes depending on a helper's return. Right now when there is a change it goes white...
Read more >How to Create a Blinking Effect with CSS3 Animations - W3docs
In this tutorial, we'll demonstrate how to create a blinking effect for a text or background easily. To achieve this goal, you need...
Read more >Delay your CSS animations to make them cleaner
CSS Transition animation can flicker on hover, this is how you can fix that! ... Engage Web profile picture; Pablo Lara H profile...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello,
I’ve noticed flickering of the image in Chrome with a normal images. Your fix didn’t help me, however my solution was quite a simple. I’ve added a z-index to the glide__slide–active class. z-index: 1 did the trick. I’ve noticed an issue when the active class gets applied to the slide index 0 after playing the whole sequence and my first guess was z-index. Hope that helps to someone.
Kudos for trying and thanks for the effort @lifeinchords!