You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 1, 2020. It is now read-only.
-[Viewer without jQuery](https://github.com/fengyuanchen/viewerjs)
7
+
8
+
9
+
10
+
## Table of contents
11
+
12
+
-[Features](#features)
13
+
-[Main](#main)
14
+
-[Getting started](#getting-started)
15
+
-[Keyboard support](#keyboard-support)
16
+
-[Options](#options)
17
+
-[Methods](#methods)
18
+
-[Events](#events)
19
+
-[No conflict](#no-conflict)
20
+
-[Browser support](#browser-support)
21
+
-[Contributing](#contributing)
22
+
-[Versioning](#versioning)
23
+
-[License](#license)
6
24
7
25
8
26
@@ -27,7 +45,7 @@
27
45
dist/
28
46
├── viewer.css ( 8 KB)
29
47
├── viewer.min.css ( 7 KB)
30
-
├── viewer.js (44 KB)
48
+
├── viewer.js (45 KB)
31
49
└── viewer.min.js (19 KB)
32
50
```
33
51
@@ -92,6 +110,7 @@ $('.images').viewer();
92
110
> Only available in modal mode.
93
111
94
112
-`Esc`: Exit full screen or stop play.
113
+
-`Space`: Stop play.
95
114
-`←`: View the previous image.
96
115
-`→`: View the next image.
97
116
-`↑`: Zoom in the image.
@@ -100,6 +119,9 @@ $('.images').viewer();
100
119
-`Ctrl + 1`: Zoom in to natural size.
101
120
102
121
122
+
[⬆ back to top](#table-of-contents)
123
+
124
+
103
125
104
126
## Options
105
127
@@ -322,25 +344,44 @@ A shortcut of the "hide.viewer" event.
322
344
A shortcut of the "hidden.viewer" event.
323
345
324
346
347
+
### view
348
+
349
+
- Type: `Function`
350
+
- Default: `null`
351
+
352
+
A shortcut of the "view.viewer" event.
353
+
354
+
355
+
### viewed
356
+
357
+
- Type: `Function`
358
+
- Default: `null`
359
+
360
+
A shortcut of the "viewed.viewer" event.
361
+
362
+
363
+
[⬆ back to top](#table-of-contents)
364
+
365
+
325
366
326
367
## Methods
327
368
328
-
As there is an**asynchronous**process when load the image(s), you **should call most of the methods after shown (modal mode) or built (inline mode)**, except "show" (modal mode) and "destroy".
369
+
As there are some**asynchronous**processes when start the viewer, you should call a method only when it is available, see the following **lifecycle**:
329
370
330
371
```js
331
-
// Modal mode
332
372
$().viewer({
373
+
built:function () {
374
+
// 2 methods are available here: "show" and "destroy".
0 commit comments