Hi, I have a DIV (image) that, when clicked, expands and inside that div user will see a menu (other divs).
Now I want to add functionality where when user clicks on any other part of the page while div is open, to close it so the menu closes.
I have a function to close the div. I also added onBlur event to the DIV to call that function. All is well, BUT it also closes the div when user clicks on soemthing inside the menu which obviously should not happen.
So I am wondering if I can usse onHover and onBlur together so that DIV only closes when user clicks OUTSIDE of it
Any suggestions are appreciated
Now I want to add functionality where when user clicks on any other part of the page while div is open, to close it so the menu closes.
I have a function to close the div. I also added onBlur event to the DIV to call that function. All is well, BUT it also closes the div when user clicks on soemthing inside the menu which obviously should not happen.
So I am wondering if I can usse onHover and onBlur together so that DIV only closes when user clicks OUTSIDE of it
Any suggestions are appreciated