Skip to content

Commit

Permalink
Fix documentation on initialization of different modes.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yadav committed May 17, 2019
1 parent 03e80db commit 16f3fe8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ If you want to show images in full screen, with predefined styles. You can use F
```js
import { FullScreenViewer } from 'iv-viewer';

const viewer = FullScreenViewer(options); // check options section for supported options
const viewer = new FullScreenViewer(options); // check options section for supported options

viewer.show('images/low-res-img', 'images/hi-res-img'); //second option is optional. Check better image loading section
```
Expand All @@ -65,7 +65,7 @@ If you have your own container to show images (you might have custom layout or g
import ImageViewer from 'iv-viewer';

const container = document.querySelector('#image-container');
const viewer = ImageViewer(container, options); //check options section for supported options
const viewer = new ImageViewer(container, options); //check options section for supported options

viewer.load('images/low-res-img', 'images/hi-res-img'); //second option is optional. Check better image loading section
```
Expand All @@ -80,7 +80,7 @@ If you just want to add zoom and pan gesture to your images in a image-viewer st
import ImageViewer from 'iv-viewer';

const image = document.querySelector('#image');
const viewer = ImageViewer(image, options); // check options section for supported options
const viewer = new ImageViewer(image, options); // check options section for supported options
```

### Options
Expand All @@ -100,13 +100,13 @@ Creating an instance
```js
import ImageViewer from 'iv-viewer';

const viewer = ImageViewer(element, options);
const viewer = new ImageViewer(element, options);
```
Here the first argument is the element, which can be container where viewer will be loaded, or it can be a image in which case viewer will be initialized in a image mode.

You can also pass a selector directly instead of a DOM element.
```js
const viewer = ImageViewer('#element', options);
const viewer = new ImageViewer('#element', options);
```

Second argument is to provide configuration options for the ImageViewer. This argument is optional.
Expand Down Expand Up @@ -161,7 +161,7 @@ Creating an instance
```js
import { FullScreenViewer } from 'iv-viewer';

const viewer = FullScreenViewer(options);
const viewer = new FullScreenViewer(options);
```
Unlike ImageViewer you don't have to pass container for the viewer as it will be initialized in pre-defined full screen container.

Expand Down
2 changes: 1 addition & 1 deletion dist/iv-viewer.es.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* iv-viewer - 2.0.0
* iv-viewer - 2.0.1
* Author : Sudhanshu Yadav
* Copyright (c) 2019 to Sudhanshu Yadav, released under the MIT license.
* git+https://github.com/s-yadav/iv-viewer.git
Expand Down
2 changes: 1 addition & 1 deletion dist/iv-viewer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* iv-viewer - 2.0.0
* iv-viewer - 2.0.1
* Author : Sudhanshu Yadav
* Copyright (c) 2019 to Sudhanshu Yadav, released under the MIT license.
* git+https://github.com/s-yadav/iv-viewer.git
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iv-viewer",
"version": "2.0.0",
"version": "2.0.1",
"description": "A zooming and panning plugin inspired by google photos for your web images.",
"main": "lib/index.js",
"repository": {
Expand Down

0 comments on commit 16f3fe8

Please sign in to comment.