L
L
Laid2019-02-14 08:21:18
Yandex maps
Laid, 2019-02-14 08:21:18

How to preload images in the Yandex.maps API?

An example of the problem
When clicking on the icon on the map, the text appears first, then the image. Because of what the block "twitches", it looks ugly.
Q: How do I make text appear when an image is loaded?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Laid, 2019-02-14
@stoik_kpd

I'm stupid to stop jerking - it's enough to prescribe a rigid height to the container in which the image is through css :)

A
Alexander, 2019-02-14
@NeiroNx

You can make a hidden element with all the pictures - but this is an extra traffic expense.
you can probably use this example with the balloon opening event to change its content when the download is completed
https://tech.yandex.ru/maps/jsbox/2.1/balloon_ajax

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question