Page 1 of 1

mouse vent help

Posted: Sun Sep 04, 2005 6:02 am
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?

Posted: Sun Sep 04, 2005 11:31 am
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.