Inside a large (even unlimited) number of tabs there is a map, initialize:
ymaps.ready(function(){ $('.tab-item').click(function(){ var myMap; initYaMap(); myMap = new ymaps.Map(document.getElementsByClassName('tracking-map__yandex-map'), { center: [53.35, 83.73], zoom: 4 }); }); }); function initYaMap () { } id cannot be used. I suppose that instead of a string, you must pass the found element according to the principle $('.classname')[0]
But nothing comes out. Can anyone come across? Is there a solution to this issue, I am familiar with the API, I don’t need references to it, I strive to solve the problem, I don’t ask someone to google it instead.
document.getElementsByClassName('tracking-map__yandex-map')returns the collection, you must take some element from it - Alexey Tenbody (.tab-item + (.tab-content .tracking-map__yandex-map). For example, there is a tab (tab), its title has a classtab-item, when you click on it, the content of the tab is shown (let's say it has atab-contentclass) and in the content there is one map with the classtracking-map__yandex-map. Looks like I have imagined? - tutankhamun