How to prevent background-image flickering in Internet Explorer/Edge?

1k Views Asked by At

I have a web page with sticky header with simple transition - when the page is scrolled down the header shrinks its size. The logo is an anchor tag with background-image. The problem is when you scroll down and the header shrinks, you see the logo image flicker before it shrinks too. This happens only in Internet Explorer (latest) and MS Edge (latest). Here is the link to the page: http://flatrockoutsourcing.com/

1

There are 1 best solutions below

0
On BEST ANSWER

I've found the reason - when the page is scrolled down and header gets the extra class - i was changing the logo dimensions (width & height) and the transition from original to fixed header dimensions caused the flickering of the logo. So instead of doing that I keep the dimensions and resize it only for certain lower resolutions. It's not the same though, the logo now stay with same width & height for fixed header and when you are at the top of the page

Found the solution - the behavior could be achieved by using transform: scale(); property