# temporary-class

> Add a class to an element for a specified amount of time.

Latest version **1.0.1** (published 2017-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install temporary-class
pnpm add temporary-class
yarn add temporary-class
bun add temporary-class
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-05-21 |
| First published | 2017-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mark Notton |
| Maintainers | marknotton |

## Links

- npm: https://www.npmjs.com/package/temporary-class
- Repository: https://github.com/marknotton/temporary-class
- npm.io page: https://npm.io/package/temporary-class

## Recent versions

- 1.0.1 (latest) — 2017-05-21

## README

# Temporary Class

Add a class to an element for a specified amount of time.

> **Credit:** This plugin is an expansion from [this forum post](http://stackoverflow.com/a/5067113/843131) by [Dan S](http://stackoverflow.com/users/625248/dan-s)

### Parameters

| Param | Type   | Description
| ----- | ------ | -----------
| 1     | string | The name of the class to be added
| 2     | number | How long the class should exist on the element
| 3     | number | Delay for then the class should be added innitially

### Usage

Add a class for 2 seconds, then remove it.
```
$("#myElement").addTemporaryClass("myClass", 2);
```

After 3 seconds, add a class for 2 seconds, then remove it.
```
$("#myElement").addTemporaryClass("myClass", 2, 3);
```

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