Skip to content
Advertisement

how to expand an image on click with JS?

I created a gallery using the following codepen and now I’m trying to add the function click to expand an image, using this JS method. Sadly I cannot get it to work.

Any advice would be very helpful, either regarding this expand option or an alternative. Mind you I’m completely new to JS.

Thanks in advance!

JavaScript
JavaScript
JavaScript

Advertisement

Answer

So after asking a collegue for help, this is what I got – an image gallery with clickable images.

Here’s the pen: https://codepen.io/fullstackgenerator/pen/YzaqYdb

JavaScript
JavaScript
JavaScript
Advertisement