amitriptyline without prescription amitriptyline for nerve pain online amitriptyline without prescription
amoxicillin 500mg capsule amoxil classification click here amoxicillin 500mg capsules for humans
amoxil 500mg amoxicillin 500mg side effects sestofiorentino.info buy amoxicillin walmart
accutane without insurance reddit accutane without birth control reddit blog.paraleap.com accutane without insurance
amoxicillin rash buy amoxicillin midstreamridgeprimary.co.za amoxicillin 500mg cost
naltrexone buy buy naltrexone canada informaticando.net buy naltrexone online cheap
buy zoloft buy sertraline 25mg 9925.org sertraline online
今天来介绍关于js的知识吧,在写前端时遇到了小麻烦于是找到了关于点击div区域外隐藏div区域代码。
首先看下JS的事件模型,JS事件模型为向上冒泡,如onclick事件在某一DOM元素被触发后,事件将跟随节点向上传播,直到有click事件绑定在某一父节点上,如果没有将直至文档的根。
阻止冒泡:1、stopPropagation()对于非IE浏览器。2、cancelBubble属性为true,对于IE浏览器,
而Jquery已经有兼容浏览器的方法,event.stopImmediatePropagation();
window.onload = function () {
document.onclick = function (e) {
$(".orderDiv").slideUp();
$("#MoreContent").hide();
}
$('#orderBtn').bind("click", function (e) {
if ($(".orderDiv").css("display") == "none") {
$(".orderDiv").slideDown();
} else {
$(".orderDiv").slideUp();
}
e = e || event; stopFunc(e);
});
//阻止向上传递事件
$('.orderDiv').bind("click", function (e) {
e = e || event; stopFunc(e);
});
}
function stopFunc(e) {
e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true;
}
--%>