EasyZoom.js支持局部放大图片,也可以生成另一张放大的预览图,而且支持鼠标平移,在移动端也可以浏览。
<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. | - |
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791