viewerjs 1.10.4 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -7
- package/dist/viewer.common.js +311 -682
- package/dist/viewer.css +18 -28
- package/dist/viewer.esm.js +311 -682
- package/dist/viewer.js +311 -682
- package/dist/viewer.min.css +3 -3
- package/dist/viewer.min.js +3 -3
- package/package.json +26 -26
- package/src/css/viewer.css +3 -1
- package/src/css/viewer.scss +3 -1
- package/src/js/defaults.js +7 -1
- package/src/js/handlers.js +11 -3
- package/src/js/methods.js +42 -19
- package/src/js/others.js +21 -11
- package/src/js/render.js +9 -3
- package/src/js/viewer.js +15 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
## Features
|
|
26
26
|
|
|
27
|
-
- Supports
|
|
27
|
+
- Supports 53 [options](#options)
|
|
28
28
|
- Supports 23 [methods](#methods)
|
|
29
29
|
- Supports 17 [events](#events)
|
|
30
30
|
- Supports modal and inline modes
|
|
@@ -290,6 +290,13 @@ Define the extra attributes to inherit from the original image.
|
|
|
290
290
|
|
|
291
291
|
> Note that the basic attributes `src` and `alt` will always inherit from the original image.
|
|
292
292
|
|
|
293
|
+
### initialCoverage
|
|
294
|
+
|
|
295
|
+
- Type: `Number`
|
|
296
|
+
- Default: `0.9`
|
|
297
|
+
|
|
298
|
+
Define the initial coverage of the viewing image. It must a positive number between 0 (0%) and 1 (100%).
|
|
299
|
+
|
|
293
300
|
### initialViewIndex
|
|
294
301
|
|
|
295
302
|
- Type: `Number`
|
|
@@ -800,17 +807,23 @@ Scale the ordinate of the image.
|
|
|
800
807
|
viewer.scaleY(-1); // Flip vertical
|
|
801
808
|
```
|
|
802
809
|
|
|
803
|
-
### zoom(ratio[,
|
|
810
|
+
### zoom(ratio[, showTooltip[, pivot]])
|
|
804
811
|
|
|
805
812
|
- **ratio**:
|
|
806
813
|
- Type: `Number`
|
|
807
814
|
- Zoom in: requires a positive number (ratio > 0)
|
|
808
815
|
- Zoom out: requires a negative number (ratio < 0)
|
|
809
816
|
|
|
810
|
-
- **
|
|
817
|
+
- **showTooltip** (optional):
|
|
811
818
|
- Type: `Boolean`
|
|
812
819
|
- Default: `false`
|
|
813
|
-
-
|
|
820
|
+
- Indicates whether to show the tooltip.
|
|
821
|
+
|
|
822
|
+
- **pivot** (optional):
|
|
823
|
+
- Type: `Object`
|
|
824
|
+
- Default: `null`
|
|
825
|
+
- Schema: `{ x: Number, y: Number }`
|
|
826
|
+
- The pivot point coordinate for zooming.
|
|
814
827
|
|
|
815
828
|
Zoom the image with a relative ratio
|
|
816
829
|
|
|
@@ -819,22 +832,34 @@ viewer.zoom(0.1);
|
|
|
819
832
|
viewer.zoom(-0.1);
|
|
820
833
|
```
|
|
821
834
|
|
|
822
|
-
### zoomTo(ratio[,
|
|
835
|
+
### zoomTo(ratio[, showTooltip[, pivot]])
|
|
823
836
|
|
|
824
837
|
- **ratio**:
|
|
825
838
|
- Type: `Number`
|
|
826
839
|
- Requires a positive number (ratio > 0)
|
|
827
840
|
|
|
828
|
-
- **
|
|
841
|
+
- **showTooltip** (optional):
|
|
829
842
|
- Type: `Boolean`
|
|
830
843
|
- Default: `false`
|
|
831
|
-
-
|
|
844
|
+
- Indicates whether to show the tooltip.
|
|
845
|
+
|
|
846
|
+
- **pivot** (optional):
|
|
847
|
+
- Type: `Object`
|
|
848
|
+
- Default: `null`
|
|
849
|
+
- Schema: `{ x: Number, y: Number }`
|
|
850
|
+
- The pivot point coordinate for zooming.
|
|
832
851
|
|
|
833
852
|
Zoom the image to an absolute ratio.
|
|
834
853
|
|
|
835
854
|
```js
|
|
836
855
|
viewer.zoomTo(0); // Zoom to zero size (0%)
|
|
837
856
|
viewer.zoomTo(1); // Zoom to natural size (100%)
|
|
857
|
+
|
|
858
|
+
// Zoom to 50% from the center of the window.
|
|
859
|
+
viewer.zoomTo(.5, {
|
|
860
|
+
x: window.innerWidth / 2,
|
|
861
|
+
y: viewer.innerHeight / 2,
|
|
862
|
+
});
|
|
838
863
|
```
|
|
839
864
|
|
|
840
865
|
### play([fullscreen])
|