<commit_before># align

Align the specified elements.

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

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

## Getting Started
Before anything taking its part, you should install [node](http://nodejs.org) and "cortex".

#### Install Node

Visit [http://nodejs.org](http://nodejs.org), download and install the proper version of nodejs.

#### Install Cortex

    # maybe you should use `sudo`
    npm install -g cortex

## Using `align` In Your Project

First, install 'align' directly with `cortex install`
	
	cortex install align --save
    
Then, use `require` method in your module
    
    var align = require('align');


## Synopsis

```js
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: 5
	}
});
```


#### options

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

<commit_msg>fix example of README.md<commit_after># align

Align the specified elements.

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

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

## Getting Started
Before anything taking its part, you should install [node](http://nodejs.org) and "cortex".

#### Install Node

Visit [http://nodejs.org](http://nodejs.org), download and install the proper version of nodejs.

#### Install Cortex

    # maybe you should use `sudo`
    npm install -g cortex

## Using `align` In Your Project

First, install 'align' directly with `cortex install`
	
	cortex install align --save
    
Then, use `require` method in your module
    
    var align = require('align');


## Synopsis

```js
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

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


{'fraction_non_alphanumeric': 0.16753666418095947, 'fraction_numerical': 0.004722843649018146, 'mean_word_length': 2.0953846153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2026198', 'n_tokens_mistral': 1256, 'n_tokens_neox': 1182, 'n_words': 361}