netconstructor / zoom.js-1

Medium's Image Zoom (no dependencies, IE 10+) https://nishanths.github.io/zoom.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ZOOM.JS

A pure JavaScript image zooming plugin; as seen on Medium.com.

Has no dependencies on jQuery or Bootstrap.

This is a port of the original version by @fat: https://github.com/fat/zoom.js

Demo

https://nishanths.github.io/zoom.js

gif

Usage

  1. Link the zoom.js and zoom.css files to your site or application. You can either download the files from GitHub or install via npm: npm i @nishanths/zoom.js.
<link href="css/zoom.css" rel="stylesheet">
<script src="dist/zoom.js"></script>
  1. Add a data-action="zoom" attribute to the images you want to make zoomable. For example:
<img src="img/blog_post_featured.png" data-action="zoom">

Differences from the original implementation

The API is the same as in the original implementation. But browser compatibility may be lower since this does not use vendor prefixes.

Compatibility

Uses the transitionend event without vendor prefixes, so IE 10 or higher.

If you need improved compatibility, please create an issue.

License

Original license

The MIT License. © 2016 Nishanth Shanmugham.

About

Medium's Image Zoom (no dependencies, IE 10+) https://nishanths.github.io/zoom.js

License:MIT License


Languages

Language:JavaScript 49.8%Language:HTML 39.3%Language:Makefile 5.7%Language:CSS 5.2%