Medium's Image Zoom for jQuery
A simple jQuery plugin for image zooming; as seen on Medium.
Demohttps://fat.github.io/zoom.js
How Link the zoom.js and zoom.css files to your site or application.<link href="css/zoom.css" rel="stylesheet"> <script src="js/zoom.js"></script> zoom.js is dependent on transition.js file from Bootstrap, so make sure to include that as well.
<script src="js/transition.js"></script>
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"> Why
It's the best way to zoom an image. It transitions/zooms in really smoothly, and then when you're done, scrolls away, [esc] keys away, clicks away… clean af.
If you hold your meta key (⌘
on mac) or (ctrl
on windows), it will open in a new tab. wow.
ps. use a data-original
attr to link to a separate image. Just for meta-clicking tho.
zoom.js should (in theory) work in all relevant browsers (ie9+). If not, create an issue! Thanks!
WhoWritten by @fat, made better by you.
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。