Pull-to-refresh is a very popular swipe gesture on smartphones that allow users to load new content on top of listed data. Its used in all popula...
For further actions, you may consider blocking this person and/or reporting abuse
This statement
if (document.body.scrollTop === 0)
constantly returns true and triggers reload animation every time you scroll up more than 100px, even if you at the very bottom of the page. Isn't is better to trigger animations only if you scroll up at the very top of the page? Like do this instead:if (window.scrollY === 0)
will it give me events like pull started , pull finessed? so that i can map it with server
Yes.. but currently these are not included in this post, you can add it easily using callbacks
this is so cool, thank you for sharing!!
I'm glad you found it helpful
let changeY = pStart.y < pCurrent.y? Math.abs(pStart.y - pCurrent.y) : 0; or it might trigger loading
Thanks man for pointing that out. Yes, otherwise it would trigger loading on swipe up as well. Great observations.
what font do you use? I love the comparison operators look. :O
I created those images using carbon
But I guess the font is Fira Code
Fira code with font ligatures
Great post brother. Thanks for sharing 👍👍
Is it really ok to self-close divs like that?
Yup