The problem occurs when you go to the "Contacts" tab FROM OTHER tabs. Namely, a gray area appears on the map (or a map on a gray area).

I tried to initialize the card twice (from the habr) and resize it after loading (from the stack), but to no avail.

Help (after these actions, the map appears in full):

  • refresh page,
  • BROWSER tabs switching
  • calling and resizing the debugging panel of GoogleChrome

Here is the address

    2 answers 2

    calling and resizing the debugging panel of GoogleChrome

    Rather resize page. Resizing the window also helps, most likely the problem disappears when you start some OnResize.

    I note that when you go from the next tab (did you mean the template menu, not the browser tabs? I didn’t understand at first ...) the region is beautifully minimized, then the content is loaded into it, then it unfolds. When booting from scratch, the area is initially deployed.

    Thus, when loading from scratch, the size of the map is calculated correctly, and when loading by AJAX, it is not, since the height of the loading area is 0. When you change the size or switch the browser tabs (by the way, the browser tabs do not have the desired effect), the OnResize and map size recalculated, but it itself is displayed anew and now correctly, since its height is no longer 0.

    As an option, you can load the map after expanding the main area into the div with opacity: 0 and then, when it has loaded, show the div with some beautiful animate effect from the zvuk. To the background you can gash rotating gif. (well, this is all IMHO, because I don't have enough experience in such things to say that doing so well or half the time).

    Added: And yes, by the way, the Increase map button also does not update its size. So if you click on it, a gray box will appear on the right.

    • about Increase Map, the gray area does not appear for the full width of the increase, but for a smaller number of pixels (which is strange). - deniz
    • Most likely the fact is that the loaded image of the card is larger than the one you see. So it simply shows what is hidden but loaded, and what is not loaded is a gray background. - Zelta

    Decided so:

    • 1. Retrieved the function initializing (loading maps) in the map.php file
    • 2. I add to ** # contenblock '#map_canvas' , after the page "turns"
    • 3. I load into #map_canvas with an Ajax map.php, and on the callback I hang up the appearance animation

    The problem with the increase was solved simply by calling the animation function initializing () in a callback