I am trying to place an object in the middle height wise of an area of the screen. I thought this code would work to calculate the Y position of my object:
- var y = $chart.offset().top + $chart.outerHeight()/2;
But the object is displaying about 60% from the top of the chart. Here are some actual numbers from the debugger:
- $chart.offset().top
- 367.79999923706055
- $chart.outerHeight()
- 451
- y
- 593.2999992370605
What would be the correct way to do something like this?