I wrote a tooltips script. I've noticed "small" problem occuring while
using the IE browser.
If a site is long enough for a scroll to appear and we move the mouse
indicator
on the link then the scroll "jumps" for a second and goes back to the
previous position.
I haven't seen it in other scripts. I have no idea what is wrong...
I enclose my script full of <br /> index in order to scroll
appearance.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-2" />
<style type="text/css">
body
{
text-align:center;
}
..tooltip
{
border-width:1px;
border-style:dashed;
border-color:#696969;
position:absolu te;
margin-top:25px;
background:#E5E 5E5;
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,nD,nDe,t V,e)
{
d=document;b=d. body;a=b.getEle mentsByTagName( 'a');
for(i=0;i<a.len gth;i++)
{
if(a[i].title)
{
a[i].onmouseover=fu nction()
{
nD=d.createElem ent('div');nD.c lassName='toolt ip';nD.id='tool tip';
b.appendChild(n D);tV=this.titl e;
nD.innerHTML=th is.title.replac e(/\|/g,"<br />");
this.title='';
}
a[i].onmousemove=fu nction()
{
if(nDe=d.getEle mentById('toolt ip'))
{
e=e||event;
with(nDe.style) {left=e.clientX +b.scrollLeft+' px';top=e.clien tY+b.scrollTop+ 'px';}
}
}
a[i].onmouseout=fun ction()
{
if(nDe=d.getEle mentById('toolt ip'))b.removeCh ild(nDe);
this.title=tV;
}
}
}
}
</script>
</head>
<body>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<a href="#" title="Test| 123, abc.">Example</a>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
</body>
</html>
using the IE browser.
If a site is long enough for a scroll to appear and we move the mouse
indicator
on the link then the scroll "jumps" for a second and goes back to the
previous position.
I haven't seen it in other scripts. I have no idea what is wrong...
I enclose my script full of <br /> index in order to scroll
appearance.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-2" />
<style type="text/css">
body
{
text-align:center;
}
..tooltip
{
border-width:1px;
border-style:dashed;
border-color:#696969;
position:absolu te;
margin-top:25px;
background:#E5E 5E5;
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,nD,nDe,t V,e)
{
d=document;b=d. body;a=b.getEle mentsByTagName( 'a');
for(i=0;i<a.len gth;i++)
{
if(a[i].title)
{
a[i].onmouseover=fu nction()
{
nD=d.createElem ent('div');nD.c lassName='toolt ip';nD.id='tool tip';
b.appendChild(n D);tV=this.titl e;
nD.innerHTML=th is.title.replac e(/\|/g,"<br />");
this.title='';
}
a[i].onmousemove=fu nction()
{
if(nDe=d.getEle mentById('toolt ip'))
{
e=e||event;
with(nDe.style) {left=e.clientX +b.scrollLeft+' px';top=e.clien tY+b.scrollTop+ 'px';}
}
}
a[i].onmouseout=fun ction()
{
if(nDe=d.getEle mentById('toolt ip'))b.removeCh ild(nDe);
this.title=tV;
}
}
}
}
</script>
</head>
<body>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<a href="#" title="Test| 123, abc.">Example</a>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br
/>
</body>
</html>
Comment