View Full Version : I need to add a delay to a tooltip script.

09-12-2008, 05:55 PM
I have been looking at ajax based tooltip scripts and found one that works well from...


But the problem is I have a page filled with a table full of links, and moving the mouse over them results in a hundred requests all at once which makes the script (and the server) stumble.

Can anyone help me add a delay to the script so you need to hover over a link for a period of time BEFORE it fires off an ajax script?

I am new to javascript so I am still puzzling out all the various bits and pieces.


09-12-2008, 06:36 PM
I have a question:

Instead of creating a delay for the hover effect and going to a link after a period of time that may be too short for the user to read,
why not put a link within the hover message that needs to be clicked for the link action to take place?

Yes, it would add an extra mouse click, but it would save one if it goes to a site you had not intended to go to and you need to click 'BACK' to return to where you were.

09-12-2008, 09:15 PM
I had too much incidental information in my question, let me try to explain again.

I have a large list of items on a page I want to add tooltips to.

The tooltips use AJAX to get their information, so a request is fired off to display it.

When you sweep the mouse across the screen, it opens a tooltip for every object the mouse moves over, creating a mess on the screeen and on the server for the hundred or more tooltips that are created.

So I would like to modify the tooltip script so it will only show the tooltip if the mouse stays on the link for a period of time. (Like a second). Nothing else needs fixed.. I just need the script to ignore the mouse until it stays over the same object for more than a second.

Thanks again. :-)