1

My site consists of three columns of elements, which can be scrolled up and down. The user selects one in each column, and the elements in each of the columns are joined by lines. However, my issue is: how can I track the absolute position of the element on the page to draw the endpoints of the array?

alexgolec
  • 26,898
  • 33
  • 107
  • 159

2 Answers2

2

With jQuery:

var left = $('css-selector').offset().left;
var top = $('css-selector').offset().top;
PitaJ
  • 12,969
  • 6
  • 36
  • 55
1

With jQuery.offset(): Get the current coordinates [...] relative to the document.

Silviu-Marian
  • 10,565
  • 6
  • 50
  • 72