I
I
Ilya Korzun2021-10-11 09:19:06
JavaScript
Ilya Korzun, 2021-10-11 09:19:06

How to filter images on the site?

Hello! I have images on the site, I need to make filters, for example (black and white and color). When you click on a black and white filter, only black and white photos should remain on the site, and all the rest were hidden, and so on with other filters.

How can I do that?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Oleg, 2021-10-11
@lolzqq

Mark each photo with the corresponding class, and when you click on the filter, hide all the pictures that did not have a class, and force them to show them if it was found. For example usingdisplay:block

V
valeriy bagriy, 2021-10-11
@hifest

https://developer.mozilla.org/en/docs/Web/CSS/filter

A
Anton Shamanov, 2021-10-11
@SilenceOfWinter

if there are problems with css filters, some of the filters can be implemented to display a semi-transparent mask image over images

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question