Tooltips script [strange problem]

Discussion in 'Javascript' started by Mario, May 4, 2005.

  1. Mario

    Mario Guest

    OK, I found solution (I've displaced part of one line):
    [similar problem is occuring while we using the background-color in
    a:hover style - don't use it ;)]

    /*

    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,e)
    {
    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';
    a.onmouseover=function()
    {
    b.appendChild(nD);
    tV=this.title;
    nD.innerHTML=this.title.replace(/\|/g,"<br />");
    this.title='';
    }
    a.onmousemove=function()
    {
    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');
    (nDe=t)?b.removeChild(nDe):'';
    this.title=tV;
    }
    }
    }
    }
     
    Mario, May 4, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SPE - Stani's Python Editor
    Replies:
    1
    Views:
    280
    SPE - Stani's Python Editor
    Dec 21, 2005
  2. Frank
    Replies:
    2
    Views:
    521
    BootNic
    Dec 7, 2006
  3. RichardOnRails
    Replies:
    0
    Views:
    91
    RichardOnRails
    Jan 30, 2008
  4. Mario

    Tooltips script [strange problem]

    Mario, May 3, 2005, in forum: Javascript
    Replies:
    14
    Views:
    206
    Randy Webb
    May 6, 2005
  5. Mario

    Tooltips script [strange problem]

    Mario, May 4, 2005, in forum: Javascript
    Replies:
    0
    Views:
    86
    Mario
    May 4, 2005
Loading...

Share This Page