Giter Site home page Giter Site logo

ncou / simple-jquery-tooltip-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arnklint/simple-jquery-tooltip-plugin

0.0 2.0 0.0 93 KB

The tiny plugin for tooltips with jQuery

Home Page: http://arnklint.com

License: MIT License

HTML 52.38% JavaScript 47.62%

simple-jquery-tooltip-plugin's Introduction

Simple Tooltip for jQuery

Simple Tooltip is a tiny plugin for making simple tooltips, when hovering over an element. It is written by Jonas Arnklint ( http://arnklint.com ). The goal is to keep it simple, tiny and agile as I'm a fan of KISS. Its functionality includes displaying generic tooltip messages as well as individual messages based on the title attribute of an element. The source was originally extracted from our easy to use CMS Venio at http://venio.se

Usage

1. Include it

.. along with jQuery (i'm including jQuery from G All Mighty in this example):

<script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="path/to/jquery.simple-tooltip.js" type="text/javascript" charset="utf-8"></script>

2. Choose elements

Select elements that you want to display a tooltip when hovering over:

<script type="text/javascript" charset="utf-8">
  jQuery(document).ready(function(){
    $('#my-link, p span').simpleTooltip({
      title: 'me is a tooltip'
    });
  });
</script>

Look at $.fn.simpleTooltip.defaults in source for more options.

3. Style it!

The tooltip gets the "v-tooltip" id so that you can style it however you want with CSS.

<style type="text/css" media="screen">
  #v-tooltip {
    position:absolute;
  	background:#000;
  	padding:3px 5px;
  	color:#fff;
  	font-size: 11px;
  	font-family: Arial, Verdana, sans-serif;
  	display:none;
    -moz-border-radius: 3px;
  	-webkit-border-radius: 3px;	
  }
</style>

4. Done!

simple-jquery-tooltip-plugin's People

Contributors

arnklint 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.