jQuery events' `stopPropagation` method does both of these (check for `e.stopPropagation`'s existence and setting `cancelBubble` to true), so just a call to that would work.

https://github.com/jquery/jquery/blob/1.8-stable/speed/jquery-basis.js#L2122