/    Sign up×
Community /Pin to ProfileBookmark

Image Collision Test

Hi,

I am building, or should I say attempting to build a fly out menu. Its hidden and when you roll over the main menu the hidden ones becomes visible.

Now can anyone give me some links to read up on detecting where the mouse went next. For instance theres a small gap between my main menu and my fly out. So simple onMouseOver() doesnt work. It will need to be a test of two things. The Image on the main menu and where it goes next.

I hope I have explained this well

Thanks

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@ExuroJun 28.2004 — I think how this is usually done is like this... When the [FONT=courier new]onmouseout[/FONT] event on your menu is called, it instigates a [FONT=courier new]setTimeout()[/FONT] for maybe half a second. When this half a second is up, the function called by the [FONT=courier new]setTimeout()[/FONT] then checks to see if the mouse is over the second section of your menu. This check can be done by using the [FONT=courier new]onmouseover[/FONT] and [FONT=courier new]onmouseout[/FONT] events on your menu to set variables saying which item (if any) the mouse is over. I hope that makes sense! If not, I've attached a page I wrote awhile back which uses this same method.

[upl-file uuid=4232b37c-fa48-4d6f-9e88-fa695abc97da size=8kB]example.txt[/upl-file]
×

Success!

Help @meta_tag 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 5.25,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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