# zoom-component

> zoom in on elements

Latest version **0.0.4** (published 2013-08-29) · 0 weekly downloads

## Install

```sh
npm install zoom-component
pnpm add zoom-component
yarn add zoom-component
bun add zoom-component
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2013-08-29 |
| First published | 2013-08-23 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mattmueller |

## Links

- npm: https://www.npmjs.com/package/zoom-component
- npm.io page: https://npm.io/package/zoom-component

## Dependencies (8)

- [ms](https://npm.io/package/ms.md) *
- [raf-component](https://npm.io/package/raf-component.md) *
- [ease-component](https://npm.io/package/ease-component.md) *
- [event-component](https://npm.io/package/event-component.md) *
- [has-translate3d](https://npm.io/package/has-translate3d.md) *
- [emitter-component](https://npm.io/package/emitter-component.md) *
- [transform-property](https://npm.io/package/transform-property.md) *
- [double-tap-component](https://npm.io/package/double-tap-component.md) *

## Recent versions

- 0.0.4 (latest) — 2013-08-29
- 0.0.3 — 2013-08-29
- 0.0.2 — 2013-08-27
- 0.0.1 — 2013-08-23

## README

# zoom

  Zoom in on an image using double click or double tap.

## Installation

  Install with [component(1)](http://component.io):

    $ component install component/zoom

## Example

```js
var zoom = require('zoom');

zoom(el, container)
  .duration('1s')
  .scale(5)
  .effect('out-bounce');
```

## Events

* `zoom in`: called after the element is zoomed in.
* `zoom out`: called after the element is zoomed out.

## API

### Zoom(el, container)

  Initialize `Zoom`.

### Zoom.duration(n:Number|String)

  Set the duration of the zoom. Defaults to `300`. Supports [guille/ms.js](https://github.com/guille/ms.js).

```js
zoom.duration('1s') // 1 second
zoom.duration(300) // 300ms
```

### Zoom.scale(n:Number)

  Set the scale of the zoom. Defaults to `3`

### Zoom.effect(effect:String)

  Set the effect of the zoom. See the aliases of [component/ease](https://github.com/component/ease) for the available effects.

```
zoom.effect('in-quad');
zoom.effect('out-bounce');
```

### Zoom.in(x:Number, y:Number)

  Programmatically zoom in on an element. `x` and `y` will be the origin of the zoom.

```
zoom.in(300, 200)
```

### Zoom.out()

  Programmatically zoom out of an element.

```js
zoom.out()
```

## License

  MIT

---
_Source: https://npm.io/package/zoom-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
