Skip to Menu

Place the selected element above another one. Also see below.

Download source from jQuery SVN

Use

Directly above

$("#mydiv").above("#myinput")

Move left by 5px and down 10px

$("#mydiv").above("#myinput", {adjustRight: -5, adjustDown: 10})

Example

This should be directly above the input.

Above

To the left To the right

Below

Known Bugs

  • The positioned element doesn't keep its position relative to the adjacent element if you zoom in or out
  • In Internet Explorer 7 if you zoom in then refresh, the element is not positioned correctly
  • Also in Internet Explorer 7, there is a gap between the positioned element and the element below it
  • Having a very large border and padding (over 50px) seems to affect Opera 8.54