Zooming 是一款支持移动设备的图片缩放库,本文共演示了6种不同的缩放DEMO展示。
默认效果
<a href="images/1.jpg">
<img class="img-zoomable" src="images/1s.jpg" alt="">
</a>
var zooming = new Zooming();
zooming.listen('.img-zoomable');
参数 | 描述 | 默认值 |
defaultZoomable | 缩放元素,可以是 css 选择器 | img[data-action=”zoom”] |
enableGrab | 是否能够抓取移动 | true |
preloadImage | 是否预加载图片 | true |
transitionDuration | 动画持续时间 | 0.4 |
transitionTimingFunction | 动画函数 | cubic-bezier(0.4, 0, 0, 1) |
bgColor | 遮罩背景颜色 | rgb(255, 255, 255) |
bgOpacity | 遮罩透明度 | 1 |
scaleBase | 缩放比例,默认为适应窗口大小 | 1 |
scaleExtra | 抓取图像时额外缩放比例 | 0.5 |
scrollThreshold | 关闭前需要多少滚动 | 40 |
customSize | 缩放到指定的宽度和高度,如果设置该属性,将忽略 scaleBase 属性 | null |
onOpen | 放大后的回调函数 | null |
onClose | 关闭后的回调函数 | null |
onRelease | 松开后的回调函数 | null |
onBeforeOpen | 放大前的回调函数 | null |
onBeforeClose | 关闭前的回调函数 | null |
onBeforeGrab | 抓取前的回调函数 | null |
onBeforeMove | 移动前的回调函数 | null |
onBeforeRelease | 松开前的回调函数 | null |
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791