JS阻止事件冒泡
<input type="button" id="js_button" />
<div id="js_div" style="width: 100px; height: 100px; display: none">
</div>
<script type="text/javascript">
$(document).ready(
function () {
$("#js_button").click(function (e) {
$("#js_div").show(300);
/*阻止冒泡事件*/
e = window.event || e;
if (e.stopPropagation) {
e.stopPropagation();
} else {
e.cancelBubble = true;
}
});
$("#js_div").click(function (e) {
/*阻止冒泡事件*/
e = window.event || e;
if (e.stopPropagation) {
e.stopPropagation();
} else {
e.cancelBubble = true;
}
});
$(document).click(function () {
$("#js_div").hide(300);
});
}
);
</script>
生活不易,五行缺金,求打点