Skip to content

Commit b8c8bcb

Browse files
authored
Merge pull request #138 from dota2Pro/master
Added Bounds in Documentation
2 parents 460ce19 + 309b958 commit b8c8bcb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,27 @@ panzoom(element, {
312312
});
313313
```
314314

315+
## Bounds on Panzoom
316+
317+
By default panzoom will not prevent Image from Panning out of the Container. `bounds` (boolean) and
318+
`boundsPadding` (number) can be defined so that it doesn't fall out. Default value for `boundsPadding` is `0.05` .
319+
320+
321+
``` js
322+
panzoom(element, {
323+
bounds: true,
324+
boundsPadding: 0.1
325+
});
326+
```
327+
328+
## Triggering Pan
329+
330+
To Pan the object using Javascript use `moveTo(<number>,<number>)` function . It expects x, y value to where to move.
331+
332+
``` js
333+
panzoom.moveTo(0, 0);
334+
```
335+
315336
# license
316337

317338
MIT

0 commit comments

Comments
 (0)