📅  最后修改于: 2022-03-11 15:03:56.488000             🧑  作者: Mango
$(document).mouseup(function(e) {
var $offCanvasInner = $(".off-canvas-inner");
// if the target of the click isn't the $offCanvasInner nor a descendant of the container
if (!$offCanvasInner.is(e.target) && $offCanvasInner.has(e.target).length === 0) {
if($('.off-canvas-wrapper').css('display') == "block"){
$('.off-canvas-wrapper').hide();
}
}
});