How to make by clicking on the picture it pop up in a new window?

Have a portfolio site that has a lot of pictures.
These pictures are set to width: 200px, so the user is difficult to see them.
You need to make it so that by clicking on the image, it pop up in a modal window, in the middle of the site.

I tried to find a ready solution on youtube and on other sources but I failed. Are there any ready solutions?
April 19th 20 at 12:41
2 answers
April 19th 20 at 12:43
Solution
Thank you! - eliezer.White commented on April 19th 20 at 12:46
April 19th 20 at 12:45
As if these problems have a huge set of ready-made solutions, for example in vanilla JS without JQ:

https://sachinchoolur.github.io/lightgallery.js/
https://feimosi.github.io/baguetteBox.js/

Well, if you use JQuery, then probably easier then to use FancyBox 3 . IMHO.

Hmm... but seriously everything is pretty easy to implement and no extra dependencies. In this example almost certainly has the standard functionality, but code quality is not too good, and work for one picture. And if 200 for example? It will help the cycle. When the window is opened of course is the animation, but when closing, it is not. Can be solved with additional classes + setTimeOut. Flipping directly in the active mode can be done, but this will be a bit more difficult.

If I find time, I'll draft up a version without dependencies and if possible, will update the answer.

Find more questions by tags JavaScriptCSS