PDA

View Full Version : Fixed Tooltip (new)



ChasDevlin
06-06-2005, 06:13 PM
Fixed Tooltip Script (http://www.dynamicdrive.com/dynamicindex5/fixedtooltip.htm)

As always, sterling work, but (!), what if you wanted the tooltip to remain in place for longer than the default i.e., to put a link inside? Either it could hang in place using a larger number of miliseconds, or it hangs for as long as a mouse hovers on it...

Is there a maximum # of miliseconds you can use before things get silly?

Additionaly, is there a way to include links inside the onMouseover tag? The quotation marks for hyperlinks seem to break the code.

Thanks...

jscheuer1
06-06-2005, 06:23 PM
Is there a maximum # of miliseconds you can use before things get silly?That's a matter of personal taste.
Additionaly, is there a way to include links inside the onMouseover tag? The quotation marks for hyperlinks seem to break the code.Try:
onMouseover="fixedtooltip('Comprehensive JavaScript <a href=\'http://www.javascriptkit.com/\'>tutorials</a> and over 400+ <b>free</b> scripts.', this, event, '150px')"

ChasDevlin
06-06-2005, 06:33 PM
John,

Thanks for the fast reply... the links inside work great. I upped the milliseconds to 5000 (5 seconds?). Is there a maximum on that?

Could the script not be modified so the tooltip remains in place for as long as a mouse hovers on it (I guess elminating the var disappeardelay)?

This is quite productive for a Monday :)

jscheuer1
06-06-2005, 06:53 PM
A better idea would be changing this in the script:
if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')to this:
if (ie4||ns6)
document.write('<div id="fixedtipdiv" onmouseover="clearhidetip()" onmouseout="delayhidetip()" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')With this scheme disappeardelay could be as little as 250.

ddadmin
06-06-2005, 07:56 PM
I think it's important to note that this is a tooltip script, meant to only provide a description of the link it's associated with, and not to carry other content like links. Based on this definition, the tooltip was designed to disappear once the user moves the mouse out of the link.

If you want the tooltip to carry content like links and not to disappear until the user actually moves the mouse out of the tooltip, consider using a drop down menu like AnyLink CSS Menu instead: http://www.dynamicdrive.com/dynamicindex1/anylinkcss.htm

ChasDevlin
06-06-2005, 08:08 PM
True... I was probably getting ahead of myself. I'd forgotten about the anylink dropdown but will certainly give it a try (which seems kinda obvious now)!

Thanks,