This javascript will help you to build tooltip for a link / button in a webpage as you wish. A "tooltip" is the small yellow box that appears when you hover over an object on your screen. It works in Internet Explorer, Opera, and Netscape 6.
Features
You can build many of tooltips for the same webpage.
You can get the tooltip information using this javascript function.
Simple and ease of use.
Just download the image, copy the code in to your page and use it.
Preview
Just move your mouse cursor over the button or image.
<!-- Script by hscripts.com --> <table id="bubble_tooltip" border=0 cellpadding=0 cellspacing=0> <tr class="bubble_top"><td></td></tr> <tr class="bubble_middle"><td><div id="bubble_tooltip_content"></div></td></tr> <tr class="bubble_bottom"><td colspan=5></td></tr> </table> Just move your mouse cursor over the button or image.<br><br> <input type="button" id="b1" value="BUTTON" onmouseover="showToolTip(event,text1)" onmouseout="hideToolTip()"></input> <br><br> <a href="#" onmouseover="showToolTip(event,text2)" onmouseout="hideToolTip()"> LINK </a> <!-- Script by hscripts.com -->
Javascript Code
<script type="text/javascript"> var text1="The tooltip is an easy way of interaction for the visitors in a web page "; var text2="For webhosting, please contact us at support@hiox.com"; //This is the text to be displayed on the tooltip. if(document.images){ pic1= new Image(); pic1.src='htooltip/bubble_top.gif'; pic2= new Image(); pic2.src='htooltip/bubble_middle.gif'; pic3= new Image(); pic3.src='htooltip/bubble_bottom.gif'; } function showToolTip(e,text){ if(document.all)e = event; var obj = document.getElementById('bubble_tooltip'); var obj2 = document.getElementById('bubble_tooltip_content'); obj2.innerHTML = text; obj.style.display = 'block'; var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop); if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0; var leftPos = e.clientX-2; if(leftPos<0)leftPos = 0; obj.style.left = leftPos + 'px'; obj.style.top = e.clientY-obj.offsetHeight+2+st+ 'px'; } function hideToolTip() { document.getElementById('bubble_tooltip').style.display = 'none'; } </script> <!-- Script by hscripts.com -->