$(document).click(
function
(e) {
var
drag = $(
"#drag"
),
dragel = $(
"#drag"
)[0],
target = e.target;
if
(dragel !== target && !$.contains(dragel, target)) {
drag.hide();
}
});
本文转自Ansue 51CTO博客,原文链接:http://blog.51cto.com/ansue/1854361,如需转载请自行联系原作者