cool hint css - Free Download Cool Configurable Tooltip Plugin - jQuery hint-css.js

Free Download Cool Configurable Tooltip Plugin – jQuery hint-css.js

Posted on

This time I will share jQuery Plugin and tutorial about Cool Configurable Tooltip Plugin – jQuery hint-css.js, hope it will help you in programming stack.

cool hint css - Free Download Cool Configurable Tooltip Plugin - jQuery hint-css.js
File Size: 7.39 KB
Views Total: 497
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

hint-css.js is the jQuery version of the Hint.css library that provides an easy way to create cool, configurable tooltips on any elements.

Key Features:

  • Fade in/out transitions.
  • Supports HTML content.
  • Allows you to specify the max-width & text alignment.
  • Easy to implement with no JS call.

How to use it:

1. Install & Download.

1 # Yarn
2 $ yarn add hint-css.js
3  
4 # NPM
5 $ npm install hint-css.js --save

2. Load the necessary JavaScript and CSS files in your HTML file.

1 <link rel="stylesheet" href="/path/to/src/hint-css.css" />
2 <script src="/path/to/jquery.min.js"></script>
3 <script src="/path/to/src/hint-css.js"></script>

3. To attach a tooltip to an element, just define the tooltip content in the data-hint attribute and the plugin will take care of the rest.

1 <button data-hint="<a href="https://www.jqueryscript.net/tooltip/">Tooltip</a> Content">
2   Hover Me
3 </button>

4. Determine the placement of the tooltip. Default: bottom.

01 <button data-hint="Tooltip Content" class="hint--top">
02   Top
03 </button>
04  
05 <button data-hint="Tooltip Content" class="hint--left">
06   Left
07 </button>
08  
09 <button data-hint="Tooltip Content" class="hint--right">
10   Right
11 </button>

5. Determine whether to allow HTML content in the tooltip.

1 <button data-hint="<b>HTML</b> Tooltips"
2         data-hint-html="true">
3         HTML Content
4 </button>

6. More configuration options to customize the tooltip. Override the default parameters in the hint-css.js as follows:

01 $.hint.defaults = {
02  
03   // additional CSS class
04   className: null,
05  
06   // time to wait before showing the tooltip
07   delayIn: 0,
08  
09   // enable/disable fade in/out transitions
10   fade: true,
11   fallback: '',
12  
13   // w/n/s/w
14   gravity: 'n',
15  
16   // same to data-hint-html
17   html: false,
18    
19   // offset in pixel
20   offset: 0,
21  
22   // opacity from 0 to 1
23   opacity: 0.8,
24  
25   // title
26   title: 'title',
27  
28   // same to data-hint-align
29   textAlign: 'center',
30  
31   // same to data-hint-max-width
32   maxWidth: 0
33    
34 }

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