Log in

View Full Version : Preview Link Content in Tooltip



dceera
04-27-2008, 06:26 PM
Hello, I am looking for information on how to bring up a tooltip that previews the content of the page of the link your cursor is hoveirng over. For example, on Espn.com, when you hover over one of the news headlines, it shows you the first few sentences of the article it is linked to. Thanks!

Nile
04-27-2008, 06:37 PM
I made a few examples around 1 - 2 weeks ago, although I don't see the tooltip it shows, you can check this out:
http://nile.richei.net/applets/tooltip/
If you go to this:
http://nile.richei.net/applets/tooltip/toolt.js
You can see all the javascript I used, the first part are arrays, as you can see:


toolt[0] = "The username is needed for your login details. When you login you will want to use this.";
toolt[1] = "The password is a secure random input that should be kept safe.";
toolt[2] = "The definition of \"Mutilated\", is broken. \"That toy is mutilated\"";
toolt[3] = "This is in a really big area. This can be useful for info that you want to provide";

You can make more, or delete some of these.
When you want the hover effect to affect. You put this on the link/button:


onMouseMove="showtooltip(x,'tooltip',event)" onMouseOut="hidetooltip('tooltip')"

I made the highlighted above, thats where you put the number of the array(toolt) you want to display.
You also need to include this on your page:

<div id="tooltip" class="toolt"></div>
Hope this Helps,
Nile

dceera
04-27-2008, 07:08 PM
Thanks for the reply. It looks from your example that the tool tip text comes from what is statically placed into it. Is that correct? I am looking for a tooltip that will grab information from another page (or from a database) based on the information contained in the link (such as an object id). Does this make sense Thanks a lot!

Nile
04-27-2008, 07:31 PM
You can do this, but you can use my tooltip to start off. You should also use a database and display that data in the js file. I only gave an example, you have to do the rest. :D