Thank you sooooo much! That's exactly the direction I needed for my code. I got it working and added an extra condition to close the layer if I clicked on an actionable item within the pop-up (i.e. close img button and/or form buttons).
On Aug 24, 1:36 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > On 8/24/07, gr00vy0ne <[EMAIL PROTECTED]> wrote: > > > > > Thanks for the info. Will the window bind work for me? > > > My understanding is that with "window bind" a click anywhere > > (including the pop-up layer) will make the layer disappear. How would > > I exclude my pop-up layer from disappearing? > > One option is compare the target property of the click event: > > $(window).bind('click', function(ev) { > if ($(ev.target).is('#myDiv')) > //don't close > else > //close > > }) > > of course ev.target could be a child of #myDiv, so in that case you might > want to add a parents() check: > > if ($(ev.target).is('#myDiv') || $(ev.target).parents('#myDiv').length) > > All untested, but gives you an idea. > > - Richard