Skip to content

Instantly share code, notes, and snippets.

@FirstWhack
Last active August 29, 2015 13:57
Show Gist options
  • Save FirstWhack/9622463 to your computer and use it in GitHub Desktop.
Save FirstWhack/9622463 to your computer and use it in GitHub Desktop.
div.tooltip { //Hey it works
background-color: #3D6199;
color: White;
position: absolute;
left: 100px;
top: 0px;
z-index: 1000000;
width: auto;
height:auto;
border-radius: 5px;
padding:20px;
}
div.tooltip:before {
border-color: transparent #3D6199 transparent transparent;
border-right: 6px solid #3D6199;
border-style: solid;
border-width: 6px 6px 6px 0px;
content: "";
display: block;
height: 0;
width: 0;
line-height: 0;
position: absolute;
top: 20%;
left: -6px;
}
div.tooltip p {
margin: 40pxpx;
color: White;
}
function toolTip(ele, whi) {
if ($("div.tooltip")) {
$("div.tooltip").remove();
}
$(ele).append('<div class="tooltip"><p>' + this.title + '</p></div>');
}
//Not dumb JQUERY
//ele.addEventListener('hover', function() {
// toolTip(this);
//}, false);
// JQUERY
//$('.hasToolTip').hover(function () { //Example of adding event listener for toolTip
// toolTip(this);
// }, function () {
// toolTip();
// });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment