Skip to content

Instantly share code, notes, and snippets.

@joshperry
Created April 3, 2015 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshperry/7b3c9143211f75be7b8a to your computer and use it in GitHub Desktop.
Save joshperry/7b3c9143211f75be7b8a to your computer and use it in GitHub Desktop.
Roll on load directive
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