/    Sign up×
Community /Pin to ProfileBookmark

tooltip event handler

Hi,

The event handler “window.onkeypress” is used to detect if a key has been pressed.

Is there a similar event handler to detect if a tooltip popup appears?

Thanks

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@HoboScriptAug 13.2008 — Hi,

The event handler "window.onkeypress" is used to detect if a key has been pressed.

Is there a similar event handler to detect if a tooltip popup appears?

Thanks[/QUOTE]


On mouse over a link or whatever makes your tooltip appear... make a timeout that runs around the same time as the appearance. If they mouse out, immediately clear the timeout so the event won't trigger.
Copy linkTweet thisAlerts:
@cdmanauthorAug 21.2008 — Hi,

Thanks for the reply. I am not sure how synchronizing the timeout with the mouseover would detect the presence of a tooltip popup. Please elaborate.

I'm proposing the following solution.


window.customEvent = printTest;

function printTest() {

document.write("Tooltip popup exist");

}


However, I'm not sure how to go about writing the customEvent handler.
Copy linkTweet thisAlerts:
@HoboScriptAug 21.2008 — Well tooltips show up after a delay. So just sync the delay with a timeout.
Copy linkTweet thisAlerts:
@cdmanauthorAug 22.2008 — Hi,

Based on your advice, I wrote the following code fragment.

Assuming the tooltip popup will appear after 2 seconds, I don't see how the timeout can detect the tooltip. Please advise. Thanks.


var timer;

window.onmouseover = startCount;

window.onmouseout = clearTimeout(timer);

function startCount() {

timer = setTimeout("alert('Tooltip popup exist')", 2000);

}
×

Success!

Help @cdman spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...