Skip to content

Instantly share code, notes, and snippets.

@dlabey
Created June 4, 2014 20:12
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 dlabey/609e34773415fb73fd0c to your computer and use it in GitHub Desktop.
Save dlabey/609e34773415fb73fd0c to your computer and use it in GitHub Desktop.
Angular Slide Vertically Directive
// Requires jquery.js, jquery.ui.effect.js, jquery.ui.effect-slide.js
// Usage: ng-slide-vertically="scopeVariable"
angular.module('namespace').directive('ngSlideVertically', function() {
return function(scope, element, attr) {
scope.$watch(attr.ngSlideVertically, function ngSlideVerticallyWatchAction(value){
if (value) {
$(element).show('slide');
} else {
$(element).hide('slide');
}
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment