Hover over ‘Line 1’ and ‘Line 2’ text to see the tooltip in action.
Line One
Line Two
Here is the complete HTML for the file. Make sure you specify proper path for the Tooltip.js file. To animate the appearing of tooltip , simply pass the second parameter of the constructor as ‘true’, followed by an integer specifying speed of animation.
<strong> Move your mouse over following lines:<br><br> <spanclass="ttip"onmouseover=if(t1)t1.Show(event,l1)onmouseout=if(t1)t1.Hide(event)> Line One </span><br> <spanclass="ttip"onmouseover=if(t1)t1.Show(event,l2)onmouseout=if(t1)t1.Hide(event)> Line Two </span> </strong>
</body> <script> var t1=null; var l1="Tooltip for line one"; var l2="Tooltip for line two"; functioninit() { t1 = newToolTip("a",true,40); } </script> </html>