T
T
tj572018-09-07 02:46:21
css
tj57, 2018-09-07 02:46:21

How to make Yandex.Maps on the site initially displayed in black and white?

I have the following fragment in my layout:
5b91bc14e250e001969995.png
The site must have Yandex.Maps. As I understand it, initially they should be black and white, and when clicked, they should already open in their usual form. How to do it ?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
0
0xD34F, 2018-09-07
@tj57

<div id="map" class="black-and-white"></div>

.black-and-white {
  filter: grayscale(100%);
}

document.querySelector('#map').addEventListener('click', function() {
  this.classList.remove('black-and-white');
}, { once: true });

jsfiddle.net/0uays3d7

B
Bondi, 2018-09-07
@Bondi

mb via JS, click event?

M
MariaSS, 2020-04-08
@MariaSS

You can do it according to the instructions: https://ez-catalog.ru/kak-sdelat-cherno-beluyu-kar...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question