tooltip alert popup - Free Download Tooltip Style Alert Popup Plugin - jQuery showToolTip

Free Download Tooltip Style Alert Popup Plugin – jQuery showToolTip

Posted on

This time I will share jQuery Plugin and tutorial about Tooltip Style Alert Popup Plugin – jQuery showToolTip, hope it will help you in programming stack.

tooltip alert popup - Free Download Tooltip Style Alert Popup Plugin - jQuery showToolTip
File Size: 5.75 KB
Views Total: 1241
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

showToolTip is a jQuery plugin to create a tooltip-style alert popup which can be attached to any element when triggered.

It provides a callback function which will be fired when the user clicks on the Okay button inside the alert popup.

The plugin grabs dimensional information about the popup, host element and the viewport width and height to calculate in which direction to show the alert popup. For example it automatically reposition the alert popup if TOP, RIGHT, BOTTOM, LEFT doesnt have enough space.

How to use it:

1. Insert jQuery library and the showToolTip plugin’s files into the HTML page.

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

2. Attach the tooltip-style alert pipup to an element and define the title & content in the JavaScript as follows:

1 $('.el').showToolTip({
2   title: 'Title',
3   content: 'Content'
4 });

3. Execute a function when the user clicks the Okay button.

1 $('.el').showToolTip({
2   title: 'Title',
3   content: 'Content',
4   onApprove: function(){
5     console.log('OK is clicked!');
6   }
7 });

4. Customize the plugin by overriding the default CSS styles.

01 .tooltip{
02   z-index: 1000;
03   word-break: break-word;
04   box-shadow: 0 0 16px 4px rgba(0,0,0, .3);
05   position: absolute;
06   font-family: Arial;
07   text-align: center;
08   color: white;
09   border-radius: 5px;
10   width: 300px;
11   overflow: hidden;
12   opacity: 0;
13 }
14  
15 .tooltip-content {
16   background-color: rgba(58,186,111, .9);
17   padding: 20px;
18 }
19  
20 .tooltip-header {
21   font-size: 30px;
22   margin-bottom: 10px;
23 }
24  
25 .tooltip-body {
26   font-size: 13px;
27 }
28  
29 .tooltip-action {
30  background-color: rgba(255,255,255, .9);
31 }
32  
33 .tooltip-btn {
34   background-color: rgba(58,186,111, .9);
35   padding: 9px 20px;
36   border: none;
37   outline: none;
38   border-radius: 4px;
39   color: white;
40   margin: 10px 0;
41   cursor: pointer;
42   font-size: 13px;
43 }
44  
45 .tooltip-btn:hover{
46   transition: all .2s;
47   background-color: rgba(34,139,34, .9);
48 }

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

source : jquery.net