An open API service indexing awesome lists of open source software.

https://github.com/normanzb/beam

Beam the element up, position element with respect to another element.
https://github.com/normanzb/beam

beam javascript position-elements

Last synced: 3 months ago
JSON representation

Beam the element up, position element with respect to another element.

Awesome Lists containing this project

README

          

# Beam

Position element with respect to another element.

## Usage ##

Move element A to the left side of element B

`$(A).beam().to(B).at("outer left and middle")`

## API Reference ##

### to

`to(el)` Specify the targetting element, source element will be moved to a position with respect to the target element.

### at

`at(location, offset, option, additionalProp`) Specify the location of current element (against targetting element).

* `location` could be: (vertical) middle, (horizontal) center, left, right, top, bottom, outer left, outer right, outer top...

* `offset` Offset { block: 2222, inline: 2222 }, block means vertical offset, inline means horizontal.

* `option` can be the `jQuery Animation Option` or just `true`, if specified, beam will invoke jQuery.fn.animate internally to move target to position with animation.

* set `option.delay = true` will delay current animation and do it all together with the other animations.

* `additionalProp` additional custom animation properties

### end
`end()` stop beaming, return the original jQuery object.

## Known Issue ##

1. Positioning goes wrong when `` or `` has border width, this is due to the differnt returning value of offsetLeft/Top when there are border, even jQuery ignores the width of border in position().