The blogging tallness Medium uses a custom picture zooming effect on their blog pages. Whenever a user clicks an picture it’ll automatically wizz into a incomparable size.
It’s a good outcome and positively singular to Medium, though it was never something that could simply be copied.
Now, with a MediumLightbox script, it’s easier than ever. This JS book is lightweight and easy to supplement into any website or blog.
If you’d like to see how this works we can revisit a live demo page hosted by creator Davide Calignano.
You will need to know a small JS to set it adult though we positively don’t need to be an expert.
Each picture can take data-* attributes for environment a full-sized tallness width, all of that are pulled dynamically from a lightbox plugin. The setup formula is really elementary and it can target a images themselves, or containers like a
Here’s a singular formula dash we need to get a plugin running:
Inside a function, you’ll pass a selector for all elements (e.g.
figure) with a
.zoom-effect class. This category is specifically defined in a MediumLightbox stylesheet, so it’s a best to use this on your page, too.
And, once that’s set up, you’re all set!
In your page calm area, we can hang all images into a
figure tab regulating this class. They’ll automatically get this dear Medium click-to-zoom outcome for both desktop and mobile users.
To download a duplicate of this book and get started, only revisit a categorical GitHub repo. Here, you’ll also find documentation along with formula snippets we can duplicate to get set adult fast.