Results 1 to 4 of 4

Thread: Cool DHTML Tooltip II can i have 2 rows?!

  1. #1
    Join Date
    Apr 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Cool DHTML Tooltip II can i have 2 rows?!

    1) Script Title: Cool DHTML Tooltip II

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...mltooltip2.htm

    3) Describe problem: Hi, quick question! does anybody know how to have multiple lines of text in the tooltip.

    i.e my tooltip is used for translation so i would want to show two lines in the tooltip. the english word then the spanish translation on the next line eg.

    hello
    hola

    so the input would be something like

    [code]<span onmouseout="ddrivetip()" onmouseover="hidedrivetip('hello','hola')">hello</span>[ICODE] or maybe a title then content ... im not sure how to do it successfully?!

    thanks to anybody that can help?!!

  2. #2
    Join Date
    Apr 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default cracked it!

    yey, for the newbie ive done it!!

    just change

    function ddrivetip(thetext, thecolor, thewidth){
    if (ns6||ie){
    if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
    if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
    tipobj.innerHTML=thetext
    enabletip=true
    return false
    }

    to this

    function ddrivetip(thetext, thesecondtext, thecolor, thewidth){
    if (ns6||ie){
    if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
    if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
    tipobj.innerHTML='<div>'+thetext+'</div>'+'<div>'+thesecondtext+'</div>'
    enabletip=true
    return false
    }

    you can add as many as you like! and style them each as they all have their own div. seems to work in all browsers like the original plugin aswell. yippee!

  3. #3
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <a href="http://www.yahoo.com" onMouseover="ddrivetip('Visit Yahoo.com/<br>tom<br />****<br />harry')";
     onMouseout="hideddrivetip()">Search Engine</a>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  4. #4
    Join Date
    Apr 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hey thanks for the help. Do you see any problems with what I have done? it seems to work great as i will be inputting a lot of translations.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •