Skip to content

Instantly share code, notes, and snippets.

@kingpabel
Created January 5, 2016 12:50
Show Gist options
  • Save kingpabel/e266295117875766124b to your computer and use it in GitHub Desktop.
Save kingpabel/e266295117875766124b to your computer and use it in GitHub Desktop.
myApp.directive("scrollable", function() {
return function(scope, element, attrs) {
var container = angular.element(element);
container.bind("scroll", function(evt) {
if (container[0].scrollTop <= 0) {
alert('On the top of the world I\'m singing I\'m dancing.');
}
/*if (container[0].offsetHeight + container[0].scrollTop >= container[0].scrollHeight) {
alert('On the bottom of the world I\'m waiting.');
}*/
});
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment