tags:

views:

47

answers:

2

I am having a div in usercontrol and i am showing the div as i have given z-index and showing as a menu item and now if i click out side the z-indexed div then the z-indexed div must close .

I need hwlp its very urgent

ThanQ, Vara Prasad.M

A: 

is this like a modal control?

Rob
i am using this as a popup control showing the div as a popup. when i click out side the popup the div must close
Vara Prasad.M
A: 

You would need to handle the click event of a parent html container, or possibly even the body itself.

For illustration something like this should work:

$(document).ready(function(){
   $("body").click(function(){
   // Check if a menu is displayed, if so hide it
   });
});

Your menu would also need some mechanism to indicate that it was currently open and a reference back to close it.

Alternatively you could declare a global function that would close any open menu's on the click event.

R Bremner