Created
April 3, 2015 18:26
-
-
Save joshperry/7b3c9143211f75be7b8a to your computer and use it in GitHub Desktop.
Roll on load 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
angular.module('saidpApp') | |
.directive('rollOnLoad', function(){ | |
return { | |
restrict: 'A', | |
link: function(scope,element){ | |
element.addClass('preroll'); | |
setTimeout(function() { | |
requestAnimationFrame(function() { | |
element.removeClass('preroll'); | |
}); | |
}, 10); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment