Last active
January 2, 2016 20:19
-
-
Save romainberger/8355744 to your computer and use it in GitHub Desktop.
Angular Qtip2 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
<a class="icon cool-icon" href="#" qtip data-content="Check out this thing"></a> |
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('app') | |
.directive('qtip', function($rootScope, $timeout, $window) { | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs) { | |
var my = attrs.my || 'bottom center' | |
, at = attrs.at || 'top center' | |
element.qtip({ | |
content: attrs.content, | |
position: { | |
my: my, | |
at: at, | |
target: element | |
}, | |
hide: { | |
fixed : true, | |
delay : 300 | |
}, | |
style: 'qtip-dark' | |
}) | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment