Angular Tooltips ================== [](https://gitter.im/720kb/angular-tooltips?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Angular Tooltips is an angularjs directive that generates a tooltip on your element. The angular tooltips is developed by [720kb](http://720kb.net). ##Requirements AngularJS v1.2+ ##Screen  ###Browser support Chrome  Firefox  Safari  Opera  IE  ## Load To use the directive, include the angular tooltips's javascript and css files in your web page: ```html
//..... ``` ##Install ###Bower installation ``` $ bower install angular-tooltips --save ``` _then load the js files in your html_ ###Add module dependency Add the 720kb.tooltips module dependency ```js angular.module('app', [ '720kb.tooltips' ]); ``` Call the directive wherever you want in your html page ```html Tooltip me ``` ##Options Angular tooltips allows you to use some options via `attribute` data ####Tooltip position You can set your tooltip to show on `left` or `right` or `top` or `bottom` position using the `tooltip-side=""` attribute ```html Tooltip me Tooltip me Tooltip me Tooltip me ``` ####Tooltip title You can set your tooltip title (text/html doesn't matter) using the `tooltip-title=""` attribute or simply via `title=""` html attribute ```html Tooltip me Tooltip me ``` ####Tooltip content You can set your tooltip content using the `tooltip-content=""` attribute ```html Tooltip me ``` ####Tooltip HTML content You can set your tooltip html content using the `tooltip-html=""` attribute ```html Tooltip me ``` ####Tooltip size You can set your tooltip size (small || medium || large) using the `tooltip-size=""` attribute ```html Tooltip me Tooltip me Tooltip me ``` ####Tooltip speed You can set the tooltip transition speed ('fast' || 'medium' || 'slow' || int(milliseconds)) using the `tooltip-speed=""` attribute ```html Tooltip fast Tooltip medium Tooltip slow Tooltip custom ``` ####Tooltip delay You can set the tooltip transition delay (ms) using the `tooltip-delay=""` attribute ```html Tooltip in 800ms ``` ####Tooltip try If space is not available for tooltip , it will automatically search for a similar alternative position to show. You can set tooltip try (1 || 0) using the `tooltip-try=""` attribute ```html Tooltip me Tooltip me ``` ####Tooltip lazy If you don't want to re-init the tooltip position everytime the tooltip trigger events are fired, you can set tooltip lazy mode (true || false) using the `tooltip-lazy=""` attribute ```html I will re-init my position everytime the mouseover event is fired I will init my position on mouseover only the first time event is fired ``` ####Tooltip triggers You can set your tooltip to show/hide on specific event/events, you can use the `tooltip-show-trigger=""` and the `tooltip-hide-trigger=""` attribute for this scope ```html Show tooltip only on click Hide tooltip only on click Show tooltip on click and mouseover and hide tooltip only on click ``` _**Close button**_ If you want to hide on click, you can configure a close button using text or HTML. This allows your users to click the button inside the tooltip instead of clicking on the original trigger. ```html Show tooltip on click and mouseover and hide tooltip only on click, with option to click on the X Show tooltip on click and mouseover and hide tooltip only on click, with option to click on HTML button ``` ####Tooltip CSS class You can set a custom CSS class or a set of, using the `tooltip-class=""` attribute: ```html I will show a tooltip with class="tooltip-custom tooltip-for-me" ``` ## Example ###[Live demo](https://720kb.github.io/angular-tooltips) ##Theming You can edit the default Css file `angular-tooltips.css` if you want to make a new theme for the tooltips. ##Contributing We will be much grateful if you help us making this project to grow up. Feel free to contribute by forking, opening issues, pull requests etc. ## License The MIT License (MIT) Copyright (c) 2014 Filippo Oretti, Dario Andrei Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.