Currently working on a mobile app using backbone and encountering an issue with detecting the position of an element in a list. I attempted to use the scrollTop property, but it consistently returns zero. Is there a specific technique for determining the position of an element relative to the screen? Here is what I have tried:
var p = $( "li:first" );
var position = p.offset();
console.warn(position.top);
Interestingly, this code snippet returns different values when tested on a computer versus a mobile phone.