EasyZoom.js支持局部放大图片,也可以生成另一张放大的预览图,而且支持鼠标平移,在移动端也可以浏览。
0、请不要问“在不在”之类的问题,有问题直接问!1、学生或暂时没有工作的童鞋,整站资源免费下载!2、¥9.9充值终身VIP会员,加我微信,826096331 拉你进VIP群学习!3、程序员加油,技术改变世界。在线 充值
<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. | - |
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群