You can use only CSS for building Tooltips, this way:
CSS
*{
font-family: Arial, sans-serif;
}
div > .tooltip, li > .tooltip, a > .tooltip, span > .tooltip {
opacity: 0;
visibility: hidden;
-webkit-transition: 0.3s;
-moz-transition: all 0.3s;
}
div:hover > .tooltip, li:hover > .tooltip, a:hover > .tooltip, span:hover > .tooltip,
a .tooltip:hover, span .tooltip:hover, li .tooltip:hover, div .tooltip:hover {
opacity: 1;
visibility: visible;
overflow: visible;
margin-top: -40px;
display: inline;
margin-left: -40px;
-webkit-transition: 0.3s;
-moz-transition: all 0.3s;
}
.tooltip {
background: #3378C1;
color: #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
padding: 10px;
margin-left: -40px;
position: absolute;
font-family: Arial;
font-size: 12px;
text-decoration: none;
font-style: normal;
z-index: 10;
}
.tooltip:before { /* Triangle */
content: "";
background: #3378C1;
border: 0;
width: 10px;
height: 10px;
margin-left: 5px;
margin-top: 20px;
display: block;
position: absolute;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
display /*\**/: none\9;
*display: none !important;
*display: none;
}
**HTML**
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<br>
<br>
<p>Este é exemplo demonstrativo de utilização de
<a href="#"><strong>Tooltips</strong>
<span class="tooltip">
Clique aqui e abra este link
</span></a>
e com isto fornecer mais uma ferramenta para seu website.</p>
Take a look at the working example here.
Modify the plugin so that it uses another attribute other than
title
would be a viable solution?– Guilherme Bernal
I thought about it. But at first I don’t know if it would be the most recommended. It’s the Bootstrap Popover.
– Joao Paulo