Created
January 5, 2016 12:50
-
-
Save kingpabel/e266295117875766124b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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