阻止默认/冒泡事件(兼容ie)
时间:2015-06-15 18:25:42
收藏:0
阅读:201
(1) 阻止默认事件
function(e){
if(e && e.preventDefault){
e.preventDefault();
}else{ //IE
window.event.returnValue = false;
}
}
(2) 阻止冒泡事件
function(e){
if(e && e.stopPropagation){
e.stopPropagation();
}else{ //IE
window.event.cancleBubble = true;
}
}
原文:http://www.cnblogs.com/cyj7/p/4578485.html
评论(0)