Skip to content

Instantly share code, notes, and snippets.

@romainberger
Last active January 2, 2016 20:19
Show Gist options
  • Save romainberger/8355744 to your computer and use it in GitHub Desktop.
Save romainberger/8355744 to your computer and use it in GitHub Desktop.
Angular Qtip2 directive
<a class="icon cool-icon" href="#" qtip data-content="Check out this thing"></a>
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