function stopBubble(e){
//一般用在鼠标或键盘事件上
if(e && e.stopPropagation){
//W3C取消冒泡事件
e.stopPropagation();
}else{
//IE取消冒泡事件
window.event.cancelBubble = true;
}
};
然后在button的click 响应函数的末尾加上
var e = window.event || arguments.callee.caller.arguments[0];
stopBubble(e);
来阻止冒泡事件
//一般用在鼠标或键盘事件上
if(e && e.stopPropagation){
//W3C取消冒泡事件
e.stopPropagation();
}else{
//IE取消冒泡事件
window.event.cancelBubble = true;
}
};
然后在button的click 响应函数的末尾加上
var e = window.event || arguments.callee.caller.arguments[0];
stopBubble(e);
来阻止冒泡事件