Datamal Blog

Thursday, May 04, 2006

DHTML Tooltip effect on blog

I am using some DHTML to generate a tooltip effect over any HTML element on the page. To do this I have used a technique described at Dynamic Drive.


Briefly, all you have to do now is add the following inside any link or page element that will contain a tooltip:

onMouseover="ddrivetip('JavaScriptKit.com JavaScript tutorials','yellow', 300)"
onMouseout="hideddrivetip()"


The key here is the function ddrivetip(); you should understand how it works:
ddrivetip('TEXT_TO_DISPLAY', 'OPTIONAL_BACKGROUND_COLOR', OPTIONAL_TIP_WIDTH)


The last two parameters are optional, and not specifying them causes the script to default to the settings within your CSS file.


Pass your mouse over the word DHTML to see what it does. Or try the code snippets above.

Unfortunately, the content of the inlined text is not read by the Blogger search tool so you won't get results in your searches for content in the Tooltips. It should just be used to get basic info about something across, saving the user a few clicks.

0 Comments:

Post a Comment

<< Home