Created
April 16, 2015 15:20
-
-
Save luizpaulogodoy/7d1d37373431d743528b to your computer and use it in GitHub Desktop.
Scroll directive
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
@app.directive "scroll", ['$window', ($window) -> | |
(scope, element, attrs) -> | |
angular.element($window).bind "scroll", -> | |
if this.pageYOffset >= 400 | |
scope.visibleGotoTop = true | |
else | |
scope.visibleGotoTop = false | |
scope.$apply() | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment