I got a function like that
我有这样的功能
$(document).mouseup(function (e)
{
var container = $("#id1");
if (!container.is(e.target) // if the target of the click isn't the container...
&& container.has(e.target).length === 0) // ... nor a descendant of the container
{
container.fadeOut();
}
var container2 = $("#id2");
if (!container2.is(e.target) // if the target of the click isn't the container...
&& container2.has(e.target).length === 0) // ... nor a descendant of the container
{
container2.fadeOut();
}
}
$(docume