Tooltips script [strange problem]

M

Mario

Second correction :)

<style type="text/css">
..tooltip
{
border-width:1px;
border-style:dashed;
border-color:#696969;
position:absolute;
margin-top:25px;
background:#E5E5E5;
color:#000000;
padding:2px;
}
</style>
<script type="text/javascript">

/*

Tooltips script v.1.0

Copyrights (c) 2005 Mariusz 'Vir' Grabczynski

free for non-commercial use

[please leave this comment intact]



Parametrs (in 'title' attributes):

| - new line [should be placed directly after words - whithout space]

*/

onload=function(d,b,a,i,nD,nDe,tV)
{
d=document;b=d.body;a=b.getElementsByTagName('a');
for(i=0;i<a.length;i++)
{
if(a.title)
{
nD=d.createElement('div');nD.className='tooltip';nD.id='tooltip';b.appendChild(nD);
a.onmouseover=function()
{
b.appendChild(nD);
tV=this.title;
nD.innerHTML=this.title.replace(/\|/g,"<br />");
this.title='';
}
a.onmousemove=function(e)
{
if(nDe=d.getElementById('tooltip'))
{
e=e||event;
with(nDe.style){left=e.clientX+b.scrollLeft+'px';top=e.clientY+b.scrollTop+'px';}
}
}
a.onmouseout=function()
{
t=d.getElementById('tooltip');if(nDe=t)b.removeChild(nDe);this.title=tV;
}
}
}
}

</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top