# css-emitter-component

> fire events on css transition and animation completion

Latest version **0.1.1** (published 2013-08-23) · BSD license · 0 weekly downloads

## Install

```sh
npm install css-emitter-component
pnpm add css-emitter-component
yarn add css-emitter-component
bun add css-emitter-component
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2013-08-23 |
| First published | 2013-08-23 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Anthony Short |
| Maintainers | anthonyshort |
| Keywords | component, css, browserify |

## Links

- npm: https://www.npmjs.com/package/css-emitter-component
- Repository: https://github.com/anthonyshort/css-emitter
- npm.io page: https://npm.io/package/css-emitter-component

## Dependencies (1)

- [event-component](https://npm.io/package/event-component.md) ~0.1.0

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2013-08-23

## README

# css-emitter

  Bind functions to `transition` and `animation` events.

## Installation

    $ component install ecarter/css-emitter

## Example

    var css = require('css-emitter');
    var el = document.querySelector('#box');

    var animate = css(el);

    // Bind
    animate.bind(function(e){
      console.log('%s property changed on %s event', e.propertyName, e.type);
    });

    // Change height and width
    setTimeout(function(){
      el.className = 'in';
    }, 1000);

### Example CSS

    #box {
      width: 100px;
      height: 100px;
      transition: all 1s ease;
      -webkit-transition: all 1s ease;
      -moz-transition: all 1s ease;
      -o-transition: all 1s ease;
      background: black;
      display: block;
    }

    #box.in {
      width: 200px;
      height: 200px;
    }

## API

### CssEmitter(target:Element)

Initialize an `CssEmitter` with given `target` element.

### CssEmitter.bind(fn:Function)

Register bind function.

### CssEmitter.unbind([fn]:Function)

Unregister bind function.

### CssEmitter.once(fn:Function)

Register a function that will fire once then unbind automatically

## License

  MIT

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