apeatling / web-pull-to-refresh

A native-like JavaScript pull to refresh implementation for the web.
https://apeatling.com/articles/javascript-pull-to-refresh-web/
MIT License
545 stars 93 forks source link

if the distance of the content element from the top of the page is > 0 the reload is triggered also when the scrollTop != 0 #5

Open patriziomunzi opened 9 years ago

patriziomunzi commented 9 years ago

this happens because at line 81, the scrollTop of the body is used:

        pan.startingPositionY = dcoument.body.scrollTop;

instead of the contentEL. So to fix this replace line 81 with

        pan.startingPositionY = options.contentEl.scrollTop;
slorber commented 8 years ago

Also there are other references to document.body in this lib. Is this lib intended to be used with another element than body?

Doesn't work well for me :'(

slorber commented 8 years ago

@patriziomunzi in your case you make it work with an element that is not body right? I tried your fix but it does not seem to work for me :(