position

- Position an element relative to the other element.

Usage

It's used as the jQuery UI position util. But this plugin only supports my/at/of options.

Examples

Example 1

$('#box-1').position({
  of: '#container'
});

Example 2

$('#box-2').position({
  my: 'left top',
  at: 'left top',
  of: '#container'
});

Example 3

$('#box-3').position({
  at: 'right bottom',
  of: '#container'
});

Example 4

$('#box-4').position({
  my: 'right+20 top-10%',
  at: 'right top',
  of: '#container'
});
1
2
3
4