Minimal HTML5 Tooltip Plugin jQuery - Download Dynamic HTML5 Tooltip Plugin For jQuery - Tooltip.js

Download Dynamic HTML5 Tooltip Plugin For jQuery – Tooltip.js

Posted on

This time I will share jQuery Plugin and tutorial about Dynamic HTML5 Tooltip Plugin For jQuery – Tooltip.js, hope it will help you in programming stack.

HTML5 Tooltip Plugin jQuery - Download Dynamic HTML5 Tooltip Plugin For jQuery - Tooltip.js
File Size: 12.4 KB
Views Total: 1467
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Tooltip.js is a simple, flexible, dynamic, highly customizable jQuery tooltip plugin which can be implemented via JavaScript or HTML5 ‘data’ attribute.

More Features:

  • Custom fade animation with delay.
  • Light and dark themes.
  • Custom text/shadow colors and font size/family.
  • Allows to change the tooltip content dynamically.
  • Also allows to display the tooltip without user interaction.

How to use it:

1. Load the stylesheet tooltip.css and JavaScript file tooltip.js in your webpage which has jQuery library loaded.

1 <link href="tooltip.css" rel="stylesheet" type="text/css">
2 <script src="//code.jquery.com/jquery.min.js"></script>
3 <script src="tooltip.js"></script>

2. Attach the plugin to a specific element and set the tooltip content in the JavaScript.

1 <span id="demo-1">Hover Me</span>
1 $('#demo-1').tooltip({
2   text: 'This is a tip'
3 });

3. You’re also able to set the tooltip content in the data-tip attribute as these:

1 <span id="demo-2" data-tip="This is the tooltip text">Hover Me</span>
1 ToolTip.init({
2   // Options here
3 });

4. Customize your tooltips by overriding the following options during init.

1 ToolTip.init({
2   delay: 400,
3   fadeDuration: 250,
4   fontSize: '1.0em',
5   theme: 'dark', //  or light
6   textColor: '#fff',
7   shadowColor: '#000',
8   fontFamily: 'Arial, Helvetica, sans-serif'
9 });

5. Set the new tooltip content:

1 $('#demo-1').tooltip('setText', 'This is the new tooltip text');

6. Display the tooltip without user interaction.

1 $('#demo-1').tooltip('autoTip', {
2   displayDuration: 5000,
3   fadeOutDuration: 1000,
4   onShowCallback: null,
5   onHideCallback: null
6 });

This awesome jQuery plugin is developed by ryanjairam. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net