Prototype.js has the stop() function, which also stops the default behaviour of an action. sometimes you want to just stop the bubble rather than the default action (for example on checkboxes)
so cross browser function to do it:
function cancel_bubble_event(event) {
//cancel the bubble but not the default action
if (event.stopPropagation){
event.stopPropagation();
}else{
event.cancelBubble = true;
}
}
called by:
window.cancel_bubble_event(event);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment