get mouse click if inside a div or not

Use this Code :

$("body > div").click(function() {
    if ($(this).attr("id") == "in_or_out") {
        // inside
    } else {
        // not inside
    }
});
OR

$(document).mouseup(function (e)
{
    var container = $("YOUR CONTAINER SELECTOR");

    if (container.has(e.target).length === 0)
    {
        container.hide();
    }
});

Comments

Popular posts from this blog

C# Crop white space from around the image

Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=xx.0.0.0, Culture=neutral, PublicKeyToken='xxx' or one of its dependencies.

The specified version string contains wildcards, which are not compatible with determinism.