L
L
lionsbet2020-04-14 17:08:36
JavaScript
lionsbet, 2020-04-14 17:08:36

How to write a script reload in a script?

On the page, when you click on a certain area, the map container block expands, and the map itself remains the same size as when the page was loaded.

How to make the script update (not the whole page) to the new dimensions?

document.getElementById('kompoziciya-25e95c19281532').onclick = function() {
        document.getElementById('map__container').classList.add('map__container--composition2');
    };

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Markov, 2020-04-14
@En-Tilza

If this is a Yandex map, then there is a method for such a case
ymap.container.fitToViewport();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question