Keywords: JavaScript, DHTML, onMouseOver, tool tip, tooltip, tool tips, tooltips

Rajneesh wrote:
>I am doing this project in ND5.0 with Oracle 8i as database. The project
>requirement is to set something sort of tool-tip for the hyperlinks.


Hi Rajneesh,

There are several ways you can accomplish tool tips in HTML.

If the tool tips need to make on-the-fly database queries,
meaning that your user moves her mouse over a link or image
and exactly then the tool tip needs to fetch the absolutely
most current up-to-the-second data from the database, then
you have a very admirable goal. It is solvable, but hard.
Let me know if this is the case, and I'll post more on it.

Otherwise, the typical need for tool tips is to display
more information about the links, images, and so forth.
Also, the typical developer is fine with embedding the
tool tips in the page HTML, meaning that when the user
retrieves the page, it already has all the tool tips
in it; they are merely hidden and then displayed later.

In the typical case, there are a few ways of doing it.
If you use typical browsers like Netscape and MSIE,
then you can do it really easily with JavaScript.

JavaScript watches when the mouse moves over any link
or image, and handles an event called "onMouseOver".
Here are two examples of the JavaScript onMouseOver:

  <a href=foo.html onMouseOver="alert('Hello');return true;">Click me</a>
  <img src=foo.gif onMouseOver="alert('World');return true;">


There is a bug in Netscape 4.6 with image onMouseOver,
so if you have images that are not links, then you
should wrap the images in dummy links like this:

  <a href=# onMouseOver="alert('Hello');return true;"><img src=foo.gif
border=0></a>


You probably want your tool tips to be more subtle.
You can do this by using the browser status bar;
when you move over the image, you should see the
text displayed at the bottom of your browser window.

  <a href=foo.html onMouseOver="window.status='Hello';return true;">Click
me</a>


When you do that with a link, the same thing happens;
some power users (like me) find this annoying because
it means I won't be able to see where the link is going.
This is probably not a big deal, just be aware of it.

If you really want to get fancy, you can have JavaScript
send tool tips to another window or frame, or even use
Dynamic HTML to display little yellow tool tips just
like in a real Java application. For more information
about JavaScript and DHTML, try the HotWired WebMonkey:

  http://www.hotwired.com/webmonkey/

You will probably like this particular page:

  http://www.hotwired.com/webmonkey/96/40/index3a.html?tw=programming

And if you want to get really sophisticated,
you can have completely awesome popup menus:

  http://developer.netscape.com/viewsource/smith_menu/smith_menu.html

Indepth reference manuals are here:

  http://developer.netscape.com/docs/manuals/communicator/dynhtml/dynamic.pdf
  http://developer.netscape.com/docs/manuals/js/client/jsref/ClientReferenceJS13.pdf
  

Cheers,

Joel

____________________________________________________________________________

Joel Henderson 
[EMAIL PROTECTED] - 1-800-558-2197
Sun NetDynamics Web Manager
http://sun.com/netdynamics/

_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to