Skip to content

A small dom element positioning lib inspired by jquery-ui/position

Notifications You must be signed in to change notification settings

alanclarke/positions

Repository files navigation

positions

A small dom element positioning lib inspired by jquery-ui/position

installation

npm install positions

features

  • no dependencies
  • simple functional api
  • well tested in ie9+
  • tiny (871 B)

usage

var positions = require('positions')
// positions els 'top left' at targets 'top left'
var css = positions(el, 'top left', target, 'top left')

top-left-top-left

// positions els 'center center' at targets 'center center'
var css = positions(el, 'center center', target, 'center center')

center-center-center-center

// positions els bottom left at targets top left
var css = positions(el, 'bottom left', target, 'top left')

bottom-left-top-left

// positions els bottom center at targets bottom center
var css = positions(el, 'bottom center', target, 'bottom center')

bottom-center-bottom-center

...etc.

run tests

npm test

browser compatibility

works in all good browsers! (also in ie9+)

Want to work on this for your day job?

This project was created by the Engineering team at Qubit. As we use open source libraries, we make our projects public where possible.

We’re currently looking to grow our team, so if you’re a JavaScript engineer and keen on ES2016 React+Redux applications and Node micro services, why not get in touch? Work with like minded engineers in an environment that has fantastic perks, including an annual ski trip, yoga, a competitive foosball league, and copious amounts of yogurt.

Find more details on our Engineering site. Don’t have an up to date CV? Just link us your Github profile! Better yet, send us a pull request that improves this project.` Contact GitHub API Training Shop Blog About

About

A small dom element positioning lib inspired by jquery-ui/position

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published