Tooltip message

Results 1 to 7 of 7

Thread: Tooltip message

  1. #1
    Dr_Michael Guest

    Default Tooltip message

    I have used the following java script to display a tooltip onmouseover a link but it hides the tooltip after a time (about 5 secs). I don&#039t want this to happen. I searched a lot and there is no variant of time delay or something else. What happens here? Why doesn&#039t it stays visible while there is no mousemovement? <BR>This script uses the onmouseout event to hide it and it&#039s normal and desired, but the problem is that it also hides the tooltip if a time expires (too short time), even if there is absolute no move of the mouse!!! Why? <BR><BR><BR><BR>if (!document.layers&&!document.all)<BR>event="test"< BR><BR>function showtip(current,e,text){<BR><BR>if (document.all){<BR>thetitle=text.split(&#039<BR>&# 039)<BR>if (thetitle.length&#062;1){<BR>thetitles=&#039&#039< BR>for (i=0;i&#060;thetitle.length;i++)<BR>thetitles+=the title[i]<BR>current.title=thetitles<BR>}<BR>else<BR>curren t.title=text<BR>}<BR><BR>else if (document.layers){<BR>document.tooltip.document.wr ite(&#039&#060;layer bgColor="white" style="border:1px solid black; font-family:fnt;font-size:12px;"&#062;&#039+text+&#039&#060;/layer&#062;&#039)<BR>document.tooltip.document.clo se()<BR>document.tooltip.left=e.pageX+5<BR>documen<BR>document.tooltip.visibi lity="show"<BR>}<BR>}<BR>function hidetip()<BR>{<BR>if (document.layers)<BR>document.tooltip.visibility=" hidden"<BR>}

  2. #2
    Join Date
    Dec 1969

    Default RE: Tooltip message

    I think you&#039ve missed some code out from that. there&#039s no call to<BR><BR>setTimeout(&#039hidetip()&#039, 5000) - which is what i&#039d expect...<BR><BR>j

  3. #3
    Dan Evans Guest

    Default RE: Tooltip message

    I think you&#039re looking at it wrong. In IE all the code does is write to the .title property of the element. IE automatically uses the title for the tooltip, requiring no JavaScript from the user. Try mousing over...<BR><BR>&#060;a href = "blah" title = "This is a tooltip"&#062;Mouseover me!&#060;/a&#062;<BR><BR>...<BR>On the otherhand, in NN there is no tooltip functionality so the code creates it&#039s own tooltip layer. If you view it in NN you will probably find that the tooltip doesn&#039t vanish until hideTip is called. If you want the same effect in IE you&#039ll have to create a DIV or something and place it over the existing tooltip.<BR><BR>All this is theory though, I haven&#039t actually tried it :o( If anyone knows better feel free to shoot me down.<BR><BR>-Dan Evans

  4. #4
    Dr_Michael Guest

    Default RE: Tooltip message

    I tried it with the title property, yes you have right it works on IE, but it also disappears after some seconds.<BR>

  5. #5
    Dr_Michael Guest

    Default RE: Tooltip message

    I have no more code than this I posted. I am totally new in Internet development and don&#039t know a lot. Well I do NOT want the message to disappear after a period of time. I just want it to disappear only when mouseout! How can I achieve this using this code, or using other code. Any suggestions?

  6. #6
    Dan Evans Guest

    Default RE: Tooltip message

    Since you seem to have the NN version sorted and only need a user made IE version, I&#039ve knocked up a quick example that you could adapt. You can find it here:<BR><BR><BR><BR>Hope this helps,<BR><BR>-Dan Evans

  7. #7
    Dr_Michael Guest

    Default RE: Tooltip message

    I appreciate your help! Finally found what I was looking for in your post! Thanx friend! ;-)

Posting Permissions

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