Zoomify.js是一款JQuery带放大缩小功能的lightboxes插件。
(下载的附件中附有DEMO)
![]() |
---|
![]() |
---|
Options:
Property | Type | Default | Description |
---|---|---|---|
duration | integer | 200 | Transition duration in milliseconds. |
easing | string | "linear" | Transition property name. |
scale | float | 0.9 | If the image is bigger than the size of the page, it represent the maximum zoom scale according to page width/height (from 0 to 1). |
方法:
Method | Description |
---|---|
zoom | Starts a zoom-in or a zoom-out transformation depending on the state of the image. |
zoomIn | Starts a zoom-in transformation. |
zoomOut | Starts a zoom-out transformation. |
reposition | Calculates the correct position of the image and moves it at the center of the visible part of page. |
事件:
Event | Description |
---|---|
zoom-in.zoomify | Fired before each zoom-in transformation. |
zoom-in-complete.zoomify | Fired after each zoom-in transformation. |
zoom-out.zoomify | Fired before each zoom-out transformation. |
zoom-out-complete.zoomify | Fired after each zoom-out transformation. |
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="js/vendor/zoomify/dist/zoomify.min.js"></script>
<link href="css/vendor/zoomify/dist/zoomify.min.css" rel="stylesheet">
<div class="wrap"> <img class="zoomify" src="images/img1.jpg" alt=""></div>
$('img.myImage1').zoomify();
// Default settings
$('img.myImage2').zoomify({ duration: 1000 });
// 1s duration
GitHub 地址 :https://github.com/indrimuska/zoomify
在线演示 :https://www.dowebok.com/demo/214/