if you try to get a top offset from a list element within a parent, and that parent is not positioned at the top, you will get a wrong value.
http://jsbin.com/yuxacuduna/1/edit?html,css,js,console,output
Try removing the margin-top
on the .container
element and you will see it will work.
What is the solution for this problem?