@@ -128,21 +128,12 @@ var viewer = new Viewer(document.getElementById('images'));
128
128
You may set viewer options with ` new Viewer(image, options) ` .
129
129
If you want to change the global default options, You may use ` Viewer.setDefaults(options) ` .
130
130
131
- ### initialViewIndex
132
-
133
- - Type: ` Number `
134
- - Default: ` 0 `
135
-
136
- Define the initial index of image for viewing.
137
-
138
- > Also used as the default parameter value of the ` view ` method.
139
-
140
- ### inline
131
+ ### backdrop
141
132
142
- - Type: ` Boolean `
143
- - Default: ` false `
133
+ - Type: ` Boolean ` or ` String `
134
+ - Default: ` true `
144
135
145
- Enable inline mode .
136
+ Enable a modal backdrop, specify ` static ` for a backdrop which doesn't close the modal on click .
146
137
147
138
### button
148
139
@@ -227,56 +218,71 @@ toolbar: {
227
218
}
228
219
```
229
220
230
- ### tooltip
221
+ ### className
231
222
232
- - Type: ` Boolean `
233
- - Default: ` true `
223
+ - Type: ` String `
224
+ - Default: ` '' `
234
225
235
- Show the tooltip with image ratio (percentage) when zoom in or zoom out .
226
+ Custom class name(s) to add to the viewer's root element .
236
227
237
- ### movable
228
+ ### container
238
229
239
- - Type: ` Boolean `
240
- - Default: ` true `
230
+ - Type: ` Element ` or ` String `
231
+ - Default: ` 'body' `
232
+ - An element or a valid selector for [ Document.querySelector] ( https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector )
241
233
242
- Enable to move the image .
234
+ The container to put the viewer in modal mode .
243
235
244
- ### zoomable
236
+ > Only available when the ` inline ` option is set to ` false ` .
245
237
246
- - Type: ` Boolean `
247
- - Default: ` true `
238
+ ### filter
248
239
249
- Enable to zoom the image.
240
+ - Type: ` Function `
241
+ - Default: ` null `
250
242
251
- ### rotatable
243
+ Filter the images for viewing (should return ` true ` if the image is viewable).
252
244
253
- - Type: ` Boolean `
254
- - Default: ` true `
245
+ For example:
255
246
256
- Enable to rotate the image.
247
+ ``` js
248
+ new Viewer (images, {
249
+ filter (image ) {
250
+ return image .complete ;
251
+ },
252
+ });
253
+ ```
257
254
258
- ### scalable
255
+ ### fullscreen
259
256
260
257
- Type: ` Boolean `
261
258
- Default: ` true `
262
259
263
- Enable to scale the image .
260
+ Enable to request full screen when play .
264
261
265
- ### transition
262
+ > Requires the browser supports [ Full Screen API ] ( http://caniuse.com/fullscreen ) .
266
263
267
- - Type: ` Boolean `
268
- - Default: ` true `
264
+ ### initialViewIndex
269
265
270
- Enable CSS3 Transition for some special elements.
266
+ - Type: ` Number `
267
+ - Default: ` 0 `
271
268
272
- ### fullscreen
269
+ Define the initial index of image for viewing.
270
+
271
+ > Also used as the default parameter value of the ` view ` method.
272
+
273
+ ### inline
273
274
274
275
- Type: ` Boolean `
275
- - Default: ` true `
276
+ - Default: ` false `
276
277
277
- Enable to request full screen when play .
278
+ Enable inline mode .
278
279
279
- > Requires the browser supports [ Full Screen API] ( http://caniuse.com/fullscreen ) .
280
+ ### interval
281
+
282
+ - Type: ` Number `
283
+ - Default: ` 5000 `
284
+
285
+ The amount of time to delay between automatically cycling an image when playing.
280
286
281
287
### keyboard
282
288
@@ -285,13 +291,6 @@ Enable to request full screen when play.
285
291
286
292
Enable keyboard support.
287
293
288
- ### backdrop
289
-
290
- - Type: ` Boolean ` or ` String `
291
- - Default: ` true `
292
-
293
- Enable a modal backdrop, specify ` static ` for a backdrop which doesn't close the modal on click.
294
-
295
294
### loading
296
295
297
296
- Type: ` Boolean `
@@ -308,13 +307,6 @@ Indicate if enable loop viewing or not.
308
307
309
308
> If the current image is the last one, then the next one to view is the first one, and vice versa.
310
309
311
- ### interval
312
-
313
- - Type: ` Number `
314
- - Default: ` 5000 `
315
-
316
- The amount of time to delay between automatically cycling an image when playing.
317
-
318
310
### minWidth
319
311
320
312
- Type: ` Number `
@@ -333,26 +325,58 @@ Define the minimum height of the viewer.
333
325
334
326
> Only available in inline mode (set the ` inline ` option to ` true ` ).
335
327
336
- ### zoomRatio
328
+ ### movable
337
329
338
- - Type: ` Number `
339
- - Default: ` 0.1 `
330
+ - Type: ` Boolean `
331
+ - Default: ` true `
340
332
341
- Define the ratio when zoom the image by wheeling mouse .
333
+ Enable to move the image.
342
334
343
- ### minZoomRatio
335
+ ### zoomable
344
336
345
- - Type: ` Number `
346
- - Default: ` 0.01 `
337
+ - Type: ` Boolean `
338
+ - Default: ` true `
347
339
348
- Define the min ratio of the image when zoom out .
340
+ Enable to zoom the image.
349
341
350
- ### maxZoomRatio
342
+ ### rotatable
351
343
352
- - Type: ` Number `
353
- - Default: ` 100 `
344
+ - Type: ` Boolean `
345
+ - Default: ` true `
354
346
355
- Define the max ratio of the image when zoom in.
347
+ Enable to rotate the image.
348
+
349
+ ### scalable
350
+
351
+ - Type: ` Boolean `
352
+ - Default: ` true `
353
+
354
+ Enable to scale the image.
355
+
356
+ ### toggleOnDblclick
357
+
358
+ - Type: ` Boolean `
359
+ - Default: ` true `
360
+
361
+ Indicate if toggle the image size between its natural size and initial size when double click on the image or not.
362
+
363
+ In other words, call the [ ` toggle ` ] ( #toggle ) method automatically when double click on the image.
364
+
365
+ > Requires [ ` dblclick ` ] ( https://developer.mozilla.org/en-US/docs/Web/Events/dblclick ) event support.
366
+
367
+ ### tooltip
368
+
369
+ - Type: ` Boolean `
370
+ - Default: ` true `
371
+
372
+ Show the tooltip with image ratio (percentage) when zoom in or zoom out.
373
+
374
+ ### transition
375
+
376
+ - Type: ` Boolean `
377
+ - Default: ` true `
378
+
379
+ Enable CSS3 Transition for some special elements.
356
380
357
381
### zIndex
358
382
@@ -368,6 +392,27 @@ Define the CSS `z-index` value of viewer in modal mode.
368
392
369
393
Define the CSS ` z-index ` value of viewer in inline mode.
370
394
395
+ ### zoomRatio
396
+
397
+ - Type: ` Number `
398
+ - Default: ` 0.1 `
399
+
400
+ Define the ratio when zoom the image by wheeling mouse.
401
+
402
+ ### minZoomRatio
403
+
404
+ - Type: ` Number `
405
+ - Default: ` 0.01 `
406
+
407
+ Define the min ratio of the image when zoom out.
408
+
409
+ ### maxZoomRatio
410
+
411
+ - Type: ` Number `
412
+ - Default: ` 100 `
413
+
414
+ Define the max ratio of the image when zoom in.
415
+
371
416
### url
372
417
373
418
- Type: ` String ` or ` Function `
@@ -392,51 +437,6 @@ new Viewer(image, {
392
437
});
393
438
```
394
439
395
- ### container
396
-
397
- - Type: ` Element ` or ` String `
398
- - Default: ` 'body' `
399
- - An element or a valid selector for [ Document.querySelector] ( https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector )
400
-
401
- The container to put the viewer in modal mode.
402
-
403
- > Only available when the ` inline ` option is set to ` false ` .
404
-
405
- ### className
406
-
407
- - Type: ` String `
408
- - Default: ` '' `
409
-
410
- Custom class name(s) to add to the viewer's root element.
411
-
412
- ### filter
413
-
414
- - Type: ` Function `
415
- - Default: ` null `
416
-
417
- Filter the images for viewing (should return ` true ` if the image is viewable).
418
-
419
- For example:
420
-
421
- ``` js
422
- new Viewer (images, {
423
- filter (image ) {
424
- return image .complete ;
425
- },
426
- });
427
- ```
428
-
429
- ### toggleOnDblclick
430
-
431
- - Type: ` Boolean `
432
- - Default: ` true `
433
-
434
- Indicate if toggle the image size between its natural size and initial size when double click on the image or not.
435
-
436
- In other words, call the [ ` toggle ` ] ( #toggle ) method automatically when double click on the image.
437
-
438
- > Requires [ ` dblclick ` ] ( https://developer.mozilla.org/en-US/docs/Web/Events/dblclick ) event support.
439
-
440
440
### ready
441
441
442
442
- Type: ` Function `
0 commit comments