Giter Club home page Giter Club logo

tooltip's Introduction

tooltip

A lightweight, easy, straight-forward and very simple tooltip made with jQuery

Demo

http://ejfrias.com/playground/tooltip

Requirement

jQuery 1.x

How to use

Just add a link to the css file in your <head> tag:

<link rel="stylesheet" href="/path/to/tooltip.css">

Then, before your closing </body> tag add:

<script src="/path/to/tooltip.js"></script>

That's it! You can now add the tooltip on any element by using data-tooltip="" attribute

<p data-tooltip="Hello world!">Hover me</p>

Options

All options are required to be prefixed with data-

Name Type Default Description
tooltip string (empty) The text that will show on the tooltip. Empty values will not show the tooltip. A class or id can be passed as well, if you have multiple tooltips that needs the same text just create an element with a class or id then put it as the data-tooltip value (e.g. .source or #source, the text of this element will then be the main source of the text of the tooltip. See example or demo to get better idea.
placement enum (top, bottom, left, right) top Position of the tooltip.
distance integer 8 Distance of the tooltip with the element in pixels.
class string (empty) Additional class for styling the tooltip, multiple classes should be separated with a space.

Contributing

Since this tooltip was made to be as simple as possible, requesting and/or proposing a feature would not be entertained. However, submitting bugs/issues are always welcome.

tooltip's People

Contributors

ejfrias avatar elvis878 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.