# align-to

> Align the specified elements.

Latest version **1.0.5** (published 2016-01-28) · 0 weekly downloads

## Install

```sh
npm install align-to
pnpm add align-to
yarn add align-to
bun add align-to
```

## 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.5 |
| Published | 2016-01-28 |
| First published | 2016-01-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kael |
| Maintainers | kael |

## Links

- npm: https://www.npmjs.com/package/align-to
- Repository: https://github.com/kaelzhang/align-to
- Issues: https://github.com/kaelzhang/align-to/issues
- npm.io page: https://npm.io/package/align-to

## Recent versions

- 1.0.5 (latest) — 2016-01-28
- 1.0.4 — 2016-01-28
- 1.0.3 — 2016-01-21

## README

# align-to

Align the specified elements.

![1](https://raw.github.com/kaelzhang/align/master/screenshots/1.png)

```
align(blue).to(yellow, ['TL', 'BL']);
```

## Synopsis

```js
var align = require('align-to')
align(element).to(target, [from, to], options);
```

## Usage

The code above will coincide the `from` point of `element` with the `to` point of the `target`.

#### element

type `Element|jQueryElement`, the element to be placed.

#### target

type `Element|jQueryElement|'viewport'`, the target which `element` will be aligned to.

#### from, to

type `String`, the symbol of a specific point

There are 7 points for a single rectangle:

```
TL ----------- TC ----------- TR
|                              |
|                              |
|                              |
|                              |
LC             CC             RC
|                              |
|                              |
|                              |
|                              |
BL ----------- BC ----------- BR
```

![2](https://raw.github.com/kaelzhang/align/master/screenshots/2.png)

```
align(blue).to(yellow, ['BC', 'BC']);
```

![3](https://raw.github.com/kaelzhang/align/master/screenshots/3.png)

```
align(blue).to(yellow, ['BR', 'BR'], {
	adjust: {
		top: 5,
		left: 10
	}
});
```


#### options

- left `number=0` the horizontal offset
- top `number=0` the vertical offset
- fix `boolean=false` if `true`, the element will be fixed to the destination position.

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