# bs-advanced-alert

> Extra functionality for the bootstrap alert component

Latest version **1.0.1** (published 2017-11-23) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install bs-advanced-alert
pnpm add bs-advanced-alert
yarn add bs-advanced-alert
bun add bs-advanced-alert
```

## 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-11-23 |
| First published | 2017-11-17 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Ade Attwood |
| Maintainers | ade-attwood |
| Keywords | bootstrap, jquery, alert, advanced |

## Links

- npm: https://www.npmjs.com/package/bs-advanced-alert
- Homepage: https://gitlab.com/AdeAttwood/bs-advanced-alert
- npm.io page: https://npm.io/package/bs-advanced-alert

## Dependencies (2)

- [jquery](https://npm.io/package/jquery.md) ^3.2.1
- [bootstrap](https://npm.io/package/bootstrap.md) ^3.3.7

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads
- [@modern-js/plugin-swc](https://npm.io/package/@modern-js/plugin-swc.md) — 3.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-11-23
- 1.0.0 — 2017-11-17

## README

# Bootstrap Advanced Alert

## Basic usage

Working in the same way as the standard alert component.

~~~html
<div class="alert alert-warning in">
    <a href="#" class="close" data-dismiss="aalert">&times;</a>
    <div class="alert-content">
        <strong>Warning!</strong> There was a problem.
    </div>
</div>
~~~

## Adding open and close effects.

You can add open and close effects the same as the standard component. The available effects are `slide` and `fade`, classes can be added to the alert component to apply the effects. If no class is added the alert will just hide.

~~~html
<div class="alert alert-success slide in">
    <a href="#" class="close" data-dismiss="aalert">&times;</a>
    <div class="alert-content">
        <strong>Success!</strong> Well done.
    </div>
</div>

<div class="alert alert-info fade in">
    <a href="#" class="close" data-dismiss="aalert">&times;</a>
    <div class="alert-content">
        <strong>Info!</strong> This is some info.
    </div>
</div>
~~~

## Timeout

You can add a `data-timeout` attribute to close the alert after a set amount of time set in milliseconds.

~~~html
<div class="alert alert-info fade in" data-timeout="1000">
    <a href="#" class="close" data-dismiss="aalert">&times;</a>
    <div class="alert-content">
        <strong>Info!</strong> This is some info.
    </div>
</div>
~~~

The above sample will close after 1 second

## jQuery extension api

### `changeTo`

This will change the alert style. The below snippet with change the `alert-` class to `alert-error`.

~~~js
$('my-alert').aalert('changeTo', 'error');
~~~

### `changeContentTo`

The will change the content of the alert. The function takes a optional second parameter `open`. This will open the alert after the content has been changed and is `true` by default.

~~~js
$('.my-alert').aalert('changeContentTo', 'Some new content', false);
~~~

### `closeAfter`

This will close the alert after the specified time

~~~js
$('my-alert').aalert('closeAfter', 2000);
~~~

### `toggle`

~~~js
$('my-alert').aalert('toggle');
~~~

### `close`

~~~js
$('my-alert').aalert('close');
~~~

### `open`

~~~js
$('my-alert').aalert('open');
~~~

## Changing functions

~~~js
$('.my-alert')
    .aalert('changeTo', 'success')
    .aalert('changeContentTo', 'Success message')
    .aalert('closeAfter', 3000);
~~~

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