建站资源下载详情
为您免费提供多种建站资源下载,包括网站模板下载、前端插件下载和字体下载!您只需注册为会员即可任意下载!

JQuery带放大缩小功能的灯箱插件Zoomify.js

来源:易助科技网浏览量:12收藏

简介

Zoomify.js是一款JQuery带放大缩小功能的lightboxes插件。

(下载的附件中附有DEMO)


JQuery带放大缩小功能的灯箱插件Zoomify.js-示例图1

JQuery带放大缩小功能的灯箱插件Zoomify.js-示例图2


Options:


PropertyTypeDefaultDescription
durationinteger200Transition duration in milliseconds.
easingstring"linear"Transition property name.
scalefloat0.9If 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).


方法:


MethodDescription
zoomStarts a zoom-in or a zoom-out transformation depending on the state of the image.
zoomInStarts a zoom-in transformation.
zoomOutStarts a zoom-out transformation.
repositionCalculates the correct position of the image and moves it at the center of the visible part of page.


事件:


EventDescription
zoom-in.zoomifyFired before each zoom-in transformation.
zoom-in-complete.zoomifyFired after each zoom-in transformation.
zoom-out.zoomifyFired before each zoom-out transformation.
zoom-out-complete.zoomifyFired after each zoom-out transformation.


使用

1.  引入文件


<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">


2.  HTML


<div class="wrap">	<img class="zoomify" src="images/img1.jpg" alt=""></div>


3.  调用


$('img.myImage1').zoomify();
// Default settings
$('img.myImage2').zoomify({ duration: 1000 }); 
// 1s duration



相关链接

GitHub 地址 :https://github.com/indrimuska/zoomify

在线演示 :https://www.dowebok.com/demo/214/