<div class="box">
<div class="content">内容</div>
</div>
上面该元素要实现标题需求(做下笔记):
$(document).click(function () {
$(".box").hide();
});
$(".box").on("click", function (event) {
//如果省略这一句,将下面的e改为event,那么IE运行可以,但是其他浏览器就不兼容
var e = arguments.callee.caller.arguments[0] || event;
if (e && e.stopPropagation) {
e.stopPropagation();
} else if (window.event) {
window.event.cancelBubble = true;
}
});