EasyZoom.js图片平移缩小放大插件

来源:https://www.sucaihuo.com/js/688.html 2016-01-19 20:54浏览(2601) 收藏

EasyZoom.js支持局部放大图片,也可以生成另一张放大的预览图,而且支持鼠标平移,在移动端也可以浏览。
EasyZoom.js图片平移缩小放大插件
分类:图片代码 > 放大镜 难易:中级
查看演示 下载资源 下载积分: 20 积分
<div class="easyzoom">
    <a href="images/zoom.jpg">
        <img src="images/standard.jpg" alt="" />
    </a>
</div>
.easyzoom {
    float: left;
}
.easyzoom img {
    display: block;
}


/* Shrink wrap strategy 2 */
.easyzoom {
    display: inline-block;
}
.easyzoom img {
    vertical-align: bottom;
}
var $easyzoom = $('.easyzoom').easyZoom();
var api = $easyzoom.data('easyZoom');

EasyZoom.js相关API教程

参数 描述 默认值
EasyZoom.js 加载提示 Loading image
errorNotice 错误提示 The image could not be loaded
errorDuration 错误延迟动画时间 毫秒 2500
preventClicks 禁止放大图片点击 true

EasyZoom.js方法Method

onShow 当弹出层显示回调 -
onHide 当弹出层消失回调 -
.show([MouseEvent|TouchEvent], [Boolean]) Displays the zoom image flyout. Optionally takes an instance of a mouse or touch event and can be set to only display the flyout if the mouse is over the target. -
.teardown() Removes all events and elements created and attached by EasyZoom. -
.swap(standardSrc, zoomSrc, [srcsetStringOrArray]) Easily switch the standard and zoom image sources. To display retina images via the srcset attribute, use the optional srcsetStringOrArray argument. -
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2