Answer the question
In order to leave comments, you need to log in
Why does All elements with background-attachment: fixed break when connecting Google maps API v3?
The site has 3 elements with background-attachment: fixed
.
When connecting google maps via js, these elements stop updating the background position.
If you change at least one css property on the site, all backgrounds are updated and become in the right positions, in accordance with the position of the scroll.
Such a bug is present on chrome, opera and Yandex browser.
In firefox and IE 11 everything works fine.
Safari on a poppy did not check.
As I understand it, the problem is with webkit itself.
Help me please.
UPD: The container in which the card is located has position: fixed
, and the card itself has transform: translateZ(0px);
.
If these properties are disabled, then the background is fixed normally, until at least 1 pixel of the map falls into the visible area and the bug returns as soon as you "move" back from the map - the background works fine again.
If anyone knows the solution, please tell me
Answer the question
In order to leave comments, you need to log in
I found the solution with the help of a lot of advice that the map needs to be given a property. I
found a solution using the method of scientific poke by prescribing all the divs of the map (except those that have transform: matrix( ... )
) to
get the following code:
#map, #map > *,
#map > .gm-style > div:not(:first-child),
#map > .gm-style > div:not(:first-child) div,
#map > .gm-style > div:first-child > div:nth-child(2),
#map > .gm-style > div > div div{
transform: none !important;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question