mouse vent help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Fourtet
Forum Commoner
Posts: 29
Joined: Fri Sep 02, 2005 5:55 pm

mouse vent help

Post by Fourtet »

Hi, I have a form field which when clicked on displays a drop down div below it.

I'm trying to acheive having the div being hidden if the user clicks outside the div. I'm not sure how to do that though. At the moment I'm just using the onblur event of the form field but that means i cant have any mouse events on the drop down div, it's a little annoying.

How can I make it so when the user clicks outside of the div it hides?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you're going to need a combination of things:

cancelBubble
toElement
currentTarget
relatedTarget
parentNode


try looking those up and see if you can sort it yourself, if not, post back in here and I'll assist further.
Post Reply