Tooltips script [strange problem]

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

  1. Mario

    Mario Guest

    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>
     
    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:
    277
    SPE - Stani's Python Editor
    Dec 21, 2005
  2. Frank
    Replies:
    2
    Views:
    511
    BootNic
    Dec 7, 2006
  3. RichardOnRails
    Replies:
    0
    Views:
    82
    RichardOnRails
    Jan 30, 2008
  4. Mario

    Tooltips script [strange problem]

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

    Tooltips script [strange problem]

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

Share This Page