asafdav / ng-scrollbar

A custom scrollbar written in pure AngularJS
MIT License
187 stars 70 forks source link

On Events #29

Open matheusml opened 9 years ago

matheusml commented 9 years ago

Hey, I'd like to know if there's a way to trigger an event when the user reached the bottom of the scroll. Thanks!

TakeshiDaveau commented 8 years ago

I agree with this feature request, furthermor it should be nice if there is an event for the bottom and for the top.

EDIT : To add the event when top is reaching you can add these lines 68

if(dragger.top === 0) {
    scope.$emit('scrollbar.toTop');
}
if(page.scrollHeight + page.top - page.height === 0) {
    scope.$emit('scrollbar.toBottom');
}