-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pull down to refresh example? #14
Comments
I'm waiting too! |
hi, |
All right, but how about ng-scroll#v1.2b and iScroll 5? |
this is my code for both pull-to-refresh and infinite-scroll using my own version of ng-iscroll (#12) and iscroll 5 $scope.loading = search.loading;
$scope.yStartFromZero = false;
$scope.$parent.myScrollOptions = {
'list_wrapper': {
snap: false,
scrollbars: 'custom',
fadeScrollbars: true,
probeType: 2,
//mouseWheel: true,
interactiveScrollbars: true,
//preventDefault: false,
on: [
{ beforeScrollStart: function () {
if (this.y === 0) {
$scope.yStartFromZero = true;
}
}},
{ scrollEnd: function () {
if ($scope.yStartFromZero && this.directionY === -1) {
this._execEvent("pullToRefresh");
}
$scope.yStartFromZero = false;
$scope.infiniteScroll = false;
}},
{ pullToRefresh: function () {
console.log('Pull to Refresh!');
}},
{ scroll: function () {
if (!$scope.infiniteScroll && !search.loading && !search.endlist && (this.y <= this.maxScrollY + 800)) {
$scope.infiniteScroll = true;
search.__search();
}
}}
]
}
}; |
JonnyBGod, thanks for the JS snippet. Could you provide the HTML as well on how do you use it as whole example? I am having trouble with this code as I tried to implement it in my case but have struggled with it. BR |
Sure, my html is as simple as: <div ng-iscroll='list_wrapper'>
<div>
<div class="YOUR CONTENT" ng-repeat="i in items track by i.id">
</div>
<div>
</div> |
I thought my problem was with the html implementation but it seems like we are ok on that side. The problem I am having is that the pull down to refresh does not load on initial page load, but rather when I refresh the view. Any thoughts on why could this be happening? BR |
I've prepared a demo - hope this helps: The DEMO includes both Pull to Refresh and "infinite" scroll (but not using the iscroll-infinite.js). |
Hi, function createScroller(wrapper, pullDownAction, scrollStart, scrollMove, scrollEnd, beforeScrollStart, enableBeforeScrollStart) {
}
}); |
Hi, does this module support pull down to refresh? If so is there a quick example of how to do it? I've tried to follow the example from the iscroll website (http://cubiq.org/dropbox/iscroll4/examples/pull-to-refresh/) but the iscroll options involve accessing the DOM and manipulating it. I was wondering if there was a proper way to do it.
Thanks!
The text was updated successfully, but these errors were encountered: