8000 GitHub - airain/angular-tooltips: Angularjs tooltips module, add tooltips to your elements
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

airain/angular-tooltips

 
 

Repository files navigation

Angular Tooltips

Angular Tooltips is an angularjs directive that generates a tooltip on your element.

The angular tooltips is developed by 720kb.

##Requirements

AngularJS v1.2+

##Screen Angular tooltips

###Browser support

Chrome ok

Firefox ok

Safari ok

Opera ok

IE mmm

Load

To use the directive, include the angular tooltips's javascript and css files in your web page:

<!DOCTYPE HTML>
<html>
<head>
  <link href="src/css/angular-tooltips.css" rel="stylesheet" type="text/css" />
</head>
<body ng-app="app">
  //.....
  <script src="src/js/angular-tooltips.js"></script>
</body>
</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

angular.module('app', [
  '720kb.tooltips'
 ]);

Call the directive wherever you want in your html page

<a href="#" tooltips title="tooltip">Tooltip me</a>

##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

<a href="#" tooltips title="tip" tooltip-side="top">Tooltip me</a>
<a href="#" tooltips title="tip" tooltip-side="bottom">Tooltip me</a>
<a href="#" tooltips title="tip" tooltip-side="left">Tooltip me</a>
<a href="#" tooltips title="tip" tooltip-side="right">Tooltip me</a>

####Tooltip content You can set your tooltip content (text/html doesn't matter) using the tooltip-content="" attribute

<a href="#" tooltips title="Tooltip" tooltip-content="<i>Woa!</i>">Tooltip me</a>

####Tooltip size You can set your tooltip size (small || medium || large) using the tooltip-size="" attribute

<a href="#" tooltips title="tip" tooltip-size="small">Tooltip me</a>
<a href="#" tooltips title="tip"tooltip-size="medium">Tooltip me</a>
<a href="#" tooltips title="tip" tooltip-size="large">Tooltip me</a>

####Tooltip try-position 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

<a href="#" tooltips title="tip" tooltip-try="1">Tooltip me</a>
<a href="#" tooltips title="tip" tooltip-try="0">Tooltip me</a>

####Tooltip event 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

<a href="#" tooltips title="tip" tooltip-show-trigger="click" tooltip-side="top">Show tooltip only on click</a>
<a href="#" tooltips title="tip" tooltip-hide-trigger="click" tooltip-side="bottom">Hide tooltip only on click</a>
<a href="#" tooltips title="tip" tooltip-show-trigger="mouseover click" tooltip-hide-trigger="click" tooltip-side="left">Show tooltip on click and mouseover and hide tooltip only on click</a>

Example

###Live demo

##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 greatful 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.

About

Angularjs tooltips module, add tooltips to your elements

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.3%
  • CSS 30.7%
0