# corner-alerts

> Helps you to put alerts in the page corners

Latest version **1.0.3** (published 2017-06-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install corner-alerts
pnpm add corner-alerts
yarn add corner-alerts
bun add corner-alerts
```

## 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.3 |
| Published | 2017-06-22 |
| First published | 2017-06-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | gabrielscarvalho |
| Maintainers | gabrielsc310 |
| Keywords | alert, corner, toast, modal-like |

## Links

- npm: https://www.npmjs.com/package/corner-alerts
- Repository: https://github.com/gabrielscarvalho/corner-alerts
- Issues: https://github.com/gabrielscarvalho/corner-alerts/issues
- npm.io page: https://npm.io/package/corner-alerts

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2017-06-22
- 1.0.2 — 2017-06-21
- 1.0.1 — 2017-06-20
- 1.0.0 — 2017-06-20

## README

# corner-alerts

Helps you to display alerts in the corners of the page.


## Mode of use

1st Import required files:

```
	<script src=".../jquery.min.js"></script>
	<script src="lib/js/corner-alerts.js"></script>
	<link rel="stylesheet" href="lib/css/style.css"/>

```


2nd Create your alerts HTML as you wish.

```	
	<div id="test1" class="alert" >
		An alert that I can make whatever I want.
		<button class="close" onclick="$('#test1').cornerAlert('bottom-right', 'hide');">X</button>
	</div>

```

3nd Initiate the plugin

```
	$(document).ready(function(){ 
		$('body').cornerAlertsInit(options);
		$('#test1').cornerAlert('bottom-right', 'show');
		setInterval(function(){
			$('#test1').cornerAlert('bottom-right', 'hide');
		}, 5000);
	});

```


##Options

You can override any of these options and create new ones.

```
	{
			'top-left': { //identifier that is used in cornerAlert(string, 'hide' | 'show')
				'id': 'corner-alert-top-left', //unique id to place
				'top': '20px',  
				'left': '20px',
				'right': 'unset',
				'bottom': 'unset',
				'addOrder': 'bottom', // when adds a new data, will put in the bottom (as last)
				'extra-class': ''
			},
			'top-right': {
				'id': 'corner-alert-top-right',
				'top': '20px',
				'left': 'unset',
				'right': '20px',
				'bottom': 'unset',
				'addOrder': 'bottom',
				'extra-class': ''
			},
			'bottom-left': {
				'id': 'corner-alert-bottom-left',
				'top': 'unset',
				'left': '20px',
				'right': 'unset',
				'bottom': '20px',
				'addOrder': 'top',
				'extra-class': ''
			},
			'bottom-right': {
				'id': 'corner-alert-bottom-right',
				'top': 'unset',
				'left': 'unset',
				'right': '20px',
				'bottom': '20px',
				'addOrder': 'top',  // when adds a new data, will put in the top (as first)
				'extra-class': ''
			},
			'MY_CUSTOM_POSITION' : {
				'id': 'corner-alert-top-middle',
				'top': '10px',
				'left': '500px',
				'right': 'unset',
				'bottom': 'unset',
				'addOrder': 'top',  // when adds a new data, will put in the top (as first)
				'extra-class': ''
			}

		};
```
Then you can call

```
	$('#id').cornerAlerts('MY_CUSTOM_POSITION', 'show');

```

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