DHTML - hover boxes

I would like to have links on my "links page" pop up a little box with a description of the link when people hover over the link. However, I really don't want a new browser window for it (for fairly obvious reasons). I have been playing around with onMouseover and onMouseout but I can't seem to get it to work.

What would be the best way of implementing this and can someone help with the code (including the JS if needed....)

Thanks in advance,
- Graham
LVL 3
topazgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sajuksCommented:
use teh title property
<a href = "http://www.google.com" title = "This is a search engine.one of the best available">Google
</a><BR>
<a href = "http://www.gmail.com" title = "My Email Account">Gmail
</a>
0
topazgAuthor Commented:
I kind of wanted an instant window instead of the delay, and would also like to be able to format the contents with colour and bolding and so on.

Thanks anyway
0
sajuksCommented:
Check the one at http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20678343.html
<html>
<head>
<title>Untitled Document</title>
<script>
var x,y, timeout;
var to = 5000;
var bd = 1;
var tablebdcolor = '#00FFFF';
var tablebgcolor = '#000000';
var headerbdcolor = '#000000';
var headerbgcolor = '#000000';
var cellbdcolor = '#000000';
var cellbgcolor = '#000000';
var font_color = '#FFFFFF';
var font_size = '1';

function init()
{
     document.onmousemove = mouseMove;
}

function mouseMove(e)
{
     x = event.x + document.body.scrollLeft;
     y = event.y + document.body.scrollTop;
}
function settip(title, desc)
{

     document.all['tip'].innerHTML = "<table border=" + bd + " bordercolor=" + tablebdcolor + " bgcolor=" + tablebgcolor + "><tr><td bordercolor=" + headerbdcolor + "><font color=" + font_color + " size=" + font_size + ">" + title + "</font></td></tr><tr><td bordercolor=" + cellbdcolor + "><font color=" + font_color + " size=" + font_size + ">" + desc + "</font></td></tr></table>";
     
     document.all['tip'].style.left = x+10;
     document.all['tip'].style.top = y+15;
     document.all['tip'].style.visibility = 'visible';
     timeout = setTimeout('cleartip()',to);
}

function cleartip()
{
     document.all['tip'].style.visibility = 'hidden';
}

</script>
</head>

<body onload="init();">
<div id="tip" style="cursor: hand; visibility: hidden; position:absolute;"></div>

<a href="#" onmouseover="settip('This is a Link','You can click it to goto another page.');" onmouseout="cleartip();">Link</a>

</body>
</html>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
topazgAuthor Commented:
Thanks very much, just what I needed - should have looked in the javascript section :-)
0
sajuksCommented:
Thanks for the points and grade
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.