()
| 913 | } |
| 914 | |
| 915 | function updateZoom() { |
| 916 | if (img.naturalWidth && img.naturalHeight) { |
| 917 | let zoom = (parseFloat(img.style.width) / img.naturalWidth).toFixed(1); |
| 918 | if (parseInt(zoom) == zoom) zoom = parseInt(zoom); |
| 919 | zoomEle.innerText = `${zoom}x`; |
| 920 | } |
| 921 | } |
| 922 | |
| 923 | const { destroy, animateTo } = enableDragAndZoom( |
| 924 | img, |