このページは、JavaScript の メソッド event.stopPropagation(); を使用したドロップダウンメニューの実装例です。
event.stopPropagation();
詳しいことはソースを見てください。