Comments (7)
Yes, at the moment it's not very useful.
from hook.
Agreed. Preventing unintentional refreshes would be a fantastic feature addition.
from hook.
I like the idea. But think about this in a real situation (I have no obligation against this idea): You are saying that when you are already at the top and try to scroll up, it refreshes. I think that would conflict with scrolling to the top if you were say half-way down the page, and scroll to the top. Think about it, when you scroll to the top you aren't going to react quickly enough to stop scrolling and stop the initiation of the refresh. Again, great idea, we just need to combine our heads and think of a unique way to tackle this subject.
from hook.
My guess is that scroll detection alone won't work. I think you'd have to do a combination of mouse drag and scroll events. OSX Webkit allows over scroll so it returns negative values but every other browser does not. That's where mouse drag would fill in the gap. If you've continued to drag 40px(or some value) while scrollTop is 0 show pull to refresh indicator.
from hook.
Oh and maybe mouse wheel as well. That's a lot of events to track so performance maybe/will an issue. If I have extra time, I'll see if this technique works at all in the browser.
Good luck
from hook.
Also touch events. I imagine Hook.js would really shine on touch devices where people are used to this method of refreshing.
from hook.
found a way to differentiate the two events.
quick demo:
would you care for a "fix" + pull request?
from hook.
Related Issues (20)
- Faster WebKit detection HOT 1
- add events HOT 3
- License? HOT 1
- Sample JS on readme has unclosed string HOT 1
- progressive enhancement
- REQUEST: Extend this feature not just to complete page, but to any element that has a scrollbar HOT 2
- Hook.js added to twittstrap resources list
- Doesnt work on android chrome
- iOS 7 (maybe all) Doesn't work unless you scroll from the very top HOT 5
- Not working with minileven jetpack theme (Wordpress)
- Doesn't work great with Bootstrap's <nav> element HOT 1
- bower support HOT 1
- website access denied HOT 1
- Add gh-pages branch for online demo
- http://usehook.com/ link broken
- Issue with full screen video
- License HOT 1
- demo isn't work HOT 5
- Incorrect markup in README
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hook.