Last Updated: February 25, 2016
·
1.271K
· irohiroki

Maximize images to fit to screen

Imagine you have a thumbnail and a full-sized image. How do you enable visitors to view the maximized one?

Maxbox is a jQuery plugin that does it nicely (mainly on iPhone). See demo.

the usage is too simple. you have a thumbnail, which is linked to the full-sized image, and do

$('img').maxbox();

(don't forget to load jQuery, maxbox.js and maxbox.css.)

MaxBox is customizable. You can specify events to maximize / restore, transition speed, CSS classes of the box and background, and how to get the url of your full-sized image. Read the README for details.

Have fun!

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside